mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
Encapsulate directive functions in anonymous functions - avoid the global namespace
This commit is contained in:
parent
b4c4b891a1
commit
78b424e247
10 changed files with 278 additions and 258 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('focusMe', focusMe);
|
.directive('focusMe', focusMe);
|
||||||
|
|
@ -21,3 +22,4 @@ function focusMe($timeout, $parse) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('fromNow', fromNow);
|
.directive('fromNow', fromNow);
|
||||||
|
|
@ -42,3 +43,4 @@ function fromNow($interval, $timeout) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('habitrpgTasks', habitrpgTasks);
|
.directive('habitrpgTasks', habitrpgTasks);
|
||||||
|
|
@ -59,3 +60,4 @@ function habitrpgTasks($rootScope, User) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('hrpgSortChecklist', hrpgSortChecklist);
|
.directive('hrpgSortChecklist', hrpgSortChecklist);
|
||||||
|
|
@ -28,3 +29,4 @@ function hrpgSortChecklist(User) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('hrpgSortTags', hrpgSortTags);
|
.directive('hrpgSortTags', hrpgSortTags);
|
||||||
|
|
@ -25,3 +26,4 @@ function hrpgSortTags(User) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('hrpgSortTasks', hrpgSortTasks);
|
.directive('hrpgSortTasks', hrpgSortTasks);
|
||||||
|
|
@ -30,3 +31,4 @@ function hrpgSortTasks(User) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('popoverHtmlPopup', popoverHtmlPopup)
|
.directive('popoverHtmlPopup', popoverHtmlPopup)
|
||||||
|
|
@ -43,3 +44,4 @@ function loadPopupTemplate($templateCache) {
|
||||||
" </div>\n" +
|
" </div>\n" +
|
||||||
"</div>\n");
|
"</div>\n");
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('popoverHtml', popoverHtml);
|
.directive('popoverHtml', popoverHtml);
|
||||||
|
|
@ -15,3 +16,4 @@ popoverHtml.$inject = [
|
||||||
function popoverHtml($compile, $timeout, $parse, $window, $tooltip) {
|
function popoverHtml($compile, $timeout, $parse, $window, $tooltip) {
|
||||||
return $tooltip('popoverHtml', 'popover', 'click');
|
return $tooltip('popoverHtml', 'popover', 'click');
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('taskFocus', taskFocus);
|
.directive('taskFocus', taskFocus);
|
||||||
|
|
@ -22,3 +23,4 @@ function taskFocus($timeout) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
(function(){
|
||||||
angular
|
angular
|
||||||
.module('habitrpg')
|
.module('habitrpg')
|
||||||
.directive('whenScrolled', whenScrolled);
|
.directive('whenScrolled', whenScrolled);
|
||||||
|
|
@ -15,3 +16,4 @@ function whenScrolled() {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue