mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Encapsulate directive functions in anonymous functions - avoid the global namespace
This commit is contained in:
@@ -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() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user