mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 02:20:14 -05:00
Convert common.js directive to common.js module
This commit is contained in:
parent
2594ff515b
commit
bd19135472
@ -1,11 +1,8 @@
|
|||||||
define(function(require) {
|
'use strict';
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var angular = require('angular');
|
var ngModule = angular.module('woDirectives', []);
|
||||||
|
|
||||||
var ngModule = angular.module('woDirectives', []);
|
ngModule.directive('woTouch', function($parse) {
|
||||||
|
|
||||||
ngModule.directive('woTouch', function($parse) {
|
|
||||||
var className = 'wo-touch-active';
|
var className = 'wo-touch-active';
|
||||||
|
|
||||||
return function(scope, elm, attrs) {
|
return function(scope, elm, attrs) {
|
||||||
@ -27,9 +24,9 @@ define(function(require) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
ngModule.directive('woTooltip', function($document, $timeout) {
|
ngModule.directive('woTooltip', function($document, $timeout) {
|
||||||
return function(scope, elm, attrs) {
|
return function(scope, elm, attrs) {
|
||||||
var selector = attrs.woTooltip;
|
var selector = attrs.woTooltip;
|
||||||
var tooltip = $document.find(selector);
|
var tooltip = $document.find(selector);
|
||||||
@ -57,9 +54,9 @@ define(function(require) {
|
|||||||
tooltip[0].style.left = '-9999px';
|
tooltip[0].style.left = '-9999px';
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
ngModule.directive('woDropdown', function($document, $timeout) {
|
ngModule.directive('woDropdown', function($document, $timeout) {
|
||||||
return function(scope, elm, attrs) {
|
return function(scope, elm, attrs) {
|
||||||
var selector = attrs.woDropdown;
|
var selector = attrs.woDropdown;
|
||||||
var position = (attrs.woDropdownPosition || '').split(' ');
|
var position = (attrs.woDropdownPosition || '').split(' ');
|
||||||
@ -137,7 +134,6 @@ define(function(require) {
|
|||||||
$document.off('touchstart.woDropdown click.woDropdown');
|
$document.off('touchstart.woDropdown click.woDropdown');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
});
|
|
||||||
|
|
||||||
return ngModule;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
module.exports = ngModule;
|
Loading…
Reference in New Issue
Block a user