You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
// Service for highlighting parts of the application
|
|
|
|
angular.module('panelApp').factory('appHighlight', function (appCss) {
|
|
|
|
|
|
|
|
//TODO: improve look of highlighting; for instance, if an element is bound and a scope,
|
|
|
|
// you will only see the most recently applied outline
|
|
|
|
var styles = {
|
|
|
|
scopes: {
|
|
|
|
selector: '.ng-scope',
|
|
|
|
style: 'border: 1px solid red'
|
|
|
|
},
|
|
|
|
bindings: {
|
|
|
|
selector: '.ng-binding',
|
|
|
|
style: 'border: 1px solid blue'
|
|
|
|
},
|
|
|
|
app: {
|
|
|
|
selector: '[ng-app]',
|
|
|
|
style: 'border: 1px solid green'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
var api = {};
|
|
|
|
|
|
|
|
for (i in styles) {
|
|
|
|
if (styles.hasOwnProperty(i)) {
|
|
|
|
// create closure around "styles"
|
|
|
|
(function () {
|
|
|
|
var style = styles[i];
|
|
|
|
api[i] = function (setting) {
|
|
|
|
if (setting) {
|
|
|
|
appCss.addCssRule(style);
|
|
|
|
} else {
|
|
|
|
appCss.removeCssRule(style);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return api;
|
|
|
|
});
|