summaryrefslogtreecommitdiff
path: root/etc/js/angular-circular-navigation.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-03-31 07:26:37 -0400
committerPliable Pixels <pliablepixels@gmail.com>2019-03-31 07:26:37 -0400
commit71114877e8e5409e37dc5a4c03015408f8e905fc (patch)
tree4d939c212d0fd21ba360012022e208be61f92e53 /etc/js/angular-circular-navigation.js
parentf02d53b6318e2bf492a5b7d6c0c7b2f6de3bb8dd (diff)
#801 rip out bower, move to unmanaged externals
Diffstat (limited to 'etc/js/angular-circular-navigation.js')
-rw-r--r--etc/js/angular-circular-navigation.js70
1 files changed, 70 insertions, 0 deletions
diff --git a/etc/js/angular-circular-navigation.js b/etc/js/angular-circular-navigation.js
new file mode 100644
index 00000000..17488768
--- /dev/null
+++ b/etc/js/angular-circular-navigation.js
@@ -0,0 +1,70 @@
+// PP - Modified to show at right angles
+/* jshint -W041 */
+/* jslint browser: true*/
+/* global cordova,StatusBar,angular,console */
+
+(function () {
+
+ 'use strict';
+
+ /*global define, module, exports, require */
+ // options.isOpen
+
+ /* istanbul ignore next */
+ var angular = window.angular ? window.angular : 'undefined' !== typeof require ? require('angular') : undefined;
+
+ var circular = angular.module('angularCircularNavigation', [])
+ .directive('circular', ['$compile', function ($compile) {
+
+ return {
+ restrict: 'EA',
+ scope: {
+ options: '='
+ },
+ template: '<button ng-click="toggleMenu()" class="cn-button {{options.button.size}}" ng-class="options.button.cssClass" style="background: {{options.button.background ? options.button.background : options.background}}; color: {{options.button.color ? options.button.color :options.color}};">{{options.content}}</button>' +
+ '<div class="cn-wrapper {{options.size}} items-{{options.items.length}}" ng-class="{\'opened-nav\':options.isOpen}"><ul>' +
+ '<li ng-repeat="item in options.items">' +
+ '<a ng-hide="item.empty" ng-click="perform(options, item)" ng-class="{\'is-active\': item.isActive}" class="{{item.cssClass}}" style="background: {{item.background ? item.background : options.background}}; color: {{item.color ? item.color : options.color}};">' +
+ '<span>{{item.content}}</span>' +
+ '</a></li></ul></div>',
+ controller: ['$scope', '$element', '$attrs',
+ function ($scope, $element, $attrs) {
+
+ $scope.toggleMenu = function () {
+ //PP
+ if (typeof $scope.options.button.onclick === 'function')
+ {
+ // PP - console.log ("FUNCTION");
+ //$scope.options.isOpen = !$scope.options.isOpen;
+ $scope.options.button.onclick();
+ }
+ else
+ {
+ // console.log ("NO FUNCTION");
+ $scope.options.isOpen = !$scope.options.isOpen;
+ }
+ };
+
+ $scope.perform = function (options, item) {
+ if (typeof item.onclick === 'function') {
+ item.onclick(options, item);
+ }
+
+ if ($scope.options.toggleOnClick) {
+ $scope.toggleMenu();
+ }
+ };
+
+ }
+ ]
+ };
+ }]);
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define('circular', ['angular'], circular);
+ } else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
+ module.exports = circular;
+ }
+
+})();