diff --git a/client/core/src/directives/acl.js b/client/core/src/directives/acl.js index 362dad65d..73100a23a 100644 --- a/client/core/src/directives/acl.js +++ b/client/core/src/directives/acl.js @@ -1,6 +1,25 @@ import {module} from '../module'; function vnAcl(aclService, $timeout) { + function getMaterialType(className) { + let type = ''; + if (className) { + type = className.replace('mdl-', '').replace('__input', ''); + type = type.charAt(0).toUpperCase() + type.slice(1); + } + return type; + } + function udateMaterial(input) { + if (input && input.className) { + let find = input.className.match(/mdl-[\w]+input/g); + if (find.length && find[0]) { + let type = getMaterialType(find[0]); + if (type && input.parentNode[`Material${type}`] && input.parentNode[`Material${type}`].updateClasses_) { + input.parentNode[`Material${type}`].updateClasses_(); + } + } + } + } return { restrict: 'A', priority: -1, @@ -18,6 +37,7 @@ function vnAcl(aclService, $timeout) { if (input) { $timeout(() => { input.setAttribute("disabled", "true"); + udateMaterial(input); }); $element[0].querySelectorAll('i, vn-drop-down').forEach(element => { element.parentNode.removeChild(element);