mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Encapsulate directive functions in anonymous functions - avoid the global namespace
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('focusMe', focusMe);
|
||||
@@ -21,3 +22,4 @@ function focusMe($timeout, $parse) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('fromNow', fromNow);
|
||||
@@ -42,3 +43,4 @@ function fromNow($interval, $timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('habitrpgTasks', habitrpgTasks);
|
||||
@@ -59,3 +60,4 @@ function habitrpgTasks($rootScope, User) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('hrpgSortChecklist', hrpgSortChecklist);
|
||||
@@ -28,3 +29,4 @@ function hrpgSortChecklist(User) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('hrpgSortTags', hrpgSortTags);
|
||||
@@ -25,3 +26,4 @@ function hrpgSortTags(User) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('hrpgSortTasks', hrpgSortTasks);
|
||||
@@ -30,3 +31,4 @@ function hrpgSortTasks(User) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('popoverHtmlPopup', popoverHtmlPopup)
|
||||
@@ -43,3 +44,4 @@ function loadPopupTemplate($templateCache) {
|
||||
" </div>\n" +
|
||||
"</div>\n");
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('popoverHtml', popoverHtml);
|
||||
@@ -15,3 +16,4 @@ popoverHtml.$inject = [
|
||||
function popoverHtml($compile, $timeout, $parse, $window, $tooltip) {
|
||||
return $tooltip('popoverHtml', 'popover', 'click');
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('taskFocus', taskFocus);
|
||||
@@ -22,3 +23,4 @@ function taskFocus($timeout) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
(function(){
|
||||
angular
|
||||
.module('habitrpg')
|
||||
.directive('whenScrolled', whenScrolled);
|
||||
@@ -15,3 +16,4 @@ function whenScrolled() {
|
||||
});
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user