#1216 uvc now deletes the styles when you change the state
gitea/salix/master This commit looks good
Details
gitea/salix/master This commit looks good
Details
This commit is contained in:
parent
8e45858cd0
commit
665f34b67e
|
@ -49,13 +49,26 @@ export function directive($http, $compile, vnApp, $translate) {
|
|||
}
|
||||
});
|
||||
|
||||
let rule = selectors.join(', ') + '{display: none;}';
|
||||
if ($scope.css)
|
||||
document.head.removeChild($scope.css);
|
||||
|
||||
$scope.css = document.createElement('style');
|
||||
document.head.appendChild($scope.css);
|
||||
$scope.css.appendChild(document.createTextNode(rule));
|
||||
if ($scope.css || document.querySelector('style[id="uvc"]')) {
|
||||
let child = document.querySelector('style[id="uvc"]');
|
||||
child.parentNode.removeChild(child);
|
||||
}
|
||||
|
||||
if (selectors.length) {
|
||||
let rule = selectors.join(', ') + '{display: none;}';
|
||||
$scope.css = document.createElement('style');
|
||||
$scope.css.setAttribute('id', 'uvc');
|
||||
document.head.appendChild($scope.css);
|
||||
$scope.css.appendChild(document.createTextNode(rule));
|
||||
}
|
||||
|
||||
$scope.$on('$destroy', () => {
|
||||
if ($scope.css && document.querySelector('style[id="uvc"]')) {
|
||||
let child = document.querySelector('style[id="uvc"]');
|
||||
child.parentNode.removeChild(child);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveConfiguration(tableConfiguration) {
|
||||
|
|
Loading…
Reference in New Issue