passman/js/app/directives/use-theme.js

26 lines
504 B
JavaScript
Raw Normal View History

2016-09-14 21:09:55 +08:00
'use strict';
/**
* @ngdoc directive
* @name passmanApp.directive:passwordGen
* @description
* # passwordGen
*/
angular.module('passmanApp')
.directive('useTheme', ['$window', function ($window) {
return {
restrict: 'A',
2016-09-27 01:15:39 +08:00
scope:{
type: '=type'
},
2016-09-14 21:09:55 +08:00
link: function (scope, el, attr, ctrl) {
var _color = $('#header').css('background-color');
2016-09-27 01:15:39 +08:00
if(!scope.type) {
$(el).css('background-color', _color);
} else {
$(el).css(scope.type, _color);
}
2016-09-14 21:09:55 +08:00
}
};
}]);