Code cleanup part #1: move all the services and directive JS code in the app.js file into its own files
This commit is contained in:
parent
3cae6609a7
commit
9b87999c1c
97 changed files with 7076 additions and 6870 deletions
35
static/js/directives/ui/tour-content.js
Normal file
35
static/js/directives/ui/tour-content.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* An element which implements a frame for content in the application tour, making sure to
|
||||
* chromify any marked elements found. Note that this directive relies on the browserchrome library
|
||||
* in the lib/ folder.
|
||||
*/
|
||||
angular.module('quay').directive('tourContent', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/tour-content.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'kind': '=kind'
|
||||
},
|
||||
controller: function($scope, $element, $timeout, UserService) {
|
||||
// Monitor any user changes and place the current user into the scope.
|
||||
UserService.updateUserIn($scope);
|
||||
|
||||
$scope.chromify = function() {
|
||||
browserchrome.update();
|
||||
};
|
||||
|
||||
$scope.$watch('kind', function(kind) {
|
||||
$timeout(function() {
|
||||
$scope.chromify();
|
||||
});
|
||||
});
|
||||
},
|
||||
link: function($scope, $element, $attr, ctrl) {
|
||||
$scope.chromify();
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
Reference in a new issue