From 210e8feae2fb4842bfb2de38666e6c41671fef3c Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 27 Sep 2017 12:42:48 -0400 Subject: removed lib --- www/lib/ng-mfb/src/mfb-directive.js | 175 ------------------------------------ 1 file changed, 175 deletions(-) delete mode 100644 www/lib/ng-mfb/src/mfb-directive.js (limited to 'www/lib/ng-mfb/src/mfb-directive.js') diff --git a/www/lib/ng-mfb/src/mfb-directive.js b/www/lib/ng-mfb/src/mfb-directive.js deleted file mode 100644 index 68a3c350..00000000 --- a/www/lib/ng-mfb/src/mfb-directive.js +++ /dev/null @@ -1,175 +0,0 @@ -+(function(window, angular, undefined){ - - 'use strict'; - - var mfb = angular.module('ng-mfb', []); - - mfb.run(['$templateCache', function($templateCache) { - $templateCache.put('ng-mfb-menu-default.tpl.html', - '' - ); - - $templateCache.put('ng-mfb-menu-md.tpl.html', - '' - ); - - $templateCache.put('ng-mfb-button-default.tpl.html', - '
  • ' + - ' ' + - ' ' + - ' ' + - ' ' + - '
  • ' - ); - - $templateCache.put('ng-mfb-button-md.tpl.html', - '
  • ' + - ' ' + - ' ' + - //' ' + - ' ' + - ' ' + - ' ' + - '
  • ' - ); - }]); - - mfb.directive('mfbMenu', ['$timeout',function($timeout){ - return { - restrict: 'EA', - transclude: true, - replace: true, - scope: { - position: '@', - effect: '@', - label: '@', - resting: '@restingIcon', - active: '@activeIcon', - mainAction: '&', - menuState: '=?', - togglingMethod: '@' - }, - templateUrl: function(elem, attrs) { - return attrs.templateUrl || 'ng-mfb-menu-default.tpl.html'; - }, - link: function(scope, elem, attrs) { - - var openState = 'open', - closedState = 'closed'; - - /** - * Check if we're on a touch-enabled device. - * Requires Modernizr to run, otherwise simply returns false - */ - function _isTouchDevice(){ - return window.Modernizr && Modernizr.touch; - } - - function _isHoverActive(){ - return scope.togglingMethod === 'hover'; - } - - /** - * Convert the toggling method to 'click'. - * This is used when 'hover' is selected by the user - * but a touch device is enabled. - */ - function useClick(){ - scope.$apply(function(){ - scope.togglingMethod = 'click'; - }); - } - /** - * Invert the current state of the menu. - */ - function flipState() { - scope.menuState = scope.menuState === openState ? closedState : openState; - } - - /** - * Set the state to user-defined value. Fallback to closed if no - * value is passed from the outside. - */ - //scope.menuState = attrs.menuState || closedState; - if(!scope.menuState){ - scope.menuState = closedState; - } - - scope.clicked = function() { - // If there is a main action, let's fire it - if (scope.mainAction) { - scope.mainAction(); - } - - if(!_isHoverActive()){ - flipState(); - } - }; - scope.hovered = function() { - if(_isHoverActive()){ - //flipState(); - } - }; - - /** - * If on touch device AND 'hover' method is selected: - * wait for the digest to perform and then change hover to click. - */ - if ( _isTouchDevice() && _isHoverActive() ){ - $timeout(useClick); - } - - attrs.$observe('menuState', function(){ - scope.currentState = scope.menuState; - }); - - } - }; - }]); - - - mfb.directive('mfbButton', [function(){ - return { - require: '^mfbMenu', - restrict: 'EA', - transclude: true, - replace: true, - scope: { - icon: '@', - label: '@' - }, - templateUrl: function(elem, attrs) { - return attrs.templateUrl || 'ng-mfb-button-default.tpl.html'; - } - }; - }]); - -})(window, angular); -- cgit v1.2.3