From 571692f4ca20bd47470c75219f57c7c2affc96be Mon Sep 17 00:00:00 2001 From: Dani Herrero Date: Thu, 25 May 2017 14:23:19 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adidos=20estilos=20a=20elementos=20desab?= =?UTF-8?q?ilitados,=20mejora=20de=20directiva=20vnAcl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client/src/web-access/index.html | 2 +- client/core/src/directives/acl.js | 21 ++++++++++++++------- client/salix/src/styles/display.css | 12 +++++++++--- services/salix/client/index.ejs | 4 ++-- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/client/client/src/web-access/index.html b/client/client/src/web-access/index.html index 1c708b6e8..d2e039024 100644 --- a/client/client/src/web-access/index.html +++ b/client/client/src/web-access/index.html @@ -38,5 +38,5 @@ - + diff --git a/client/core/src/directives/acl.js b/client/core/src/directives/acl.js index b6c4bc162..bb7657a08 100644 --- a/client/core/src/directives/acl.js +++ b/client/core/src/directives/acl.js @@ -3,16 +3,23 @@ import {module} from '../module'; function vnAcl(aclService, $compile) { return { restrict: 'A', - link: function(scope, element, attrs) { - let acls = attrs.vnAcl.split(','); - let action = attrs.vnAclAction || 'disabled'; + link: function($scope, $element, $attrs) { + let acls = $attrs.vnAcl.split(','); + let action = $attrs.vnAclAction || 'disabled'; if (!aclService.aclPermission(acls)) { if (action === 'disabled') { - let input = element[0].querySelector('input'); - input.setAttribute("ng-disabled", "true"); - $compile(input)(scope); + let input = $element[0]; + let selector = 'input, textarea, button, submit'; + + if (!input.matches(selector)) + input = input.querySelector(selector); + + if (input) { + input.setAttribute("ng-disabled", "true"); + $compile(input)($scope); + } } else { - element.remove(); + $element.remove(); } } } diff --git a/client/salix/src/styles/display.css b/client/salix/src/styles/display.css index 1e5c718cc..9ead8140d 100644 --- a/client/salix/src/styles/display.css +++ b/client/salix/src/styles/display.css @@ -1,4 +1,4 @@ -.display-block{ +.display-block { display: block; } .well { @@ -15,12 +15,12 @@ } /* Label del popover */ -.popover-button{ +.popover-button { padding: 3px 3px 3px 0px; height: auto; min-width: auto; } -.popover-label{ +.popover-label { font-weight: bold; color: black; padding-top:5px; @@ -32,3 +32,9 @@ height: 46px; line-height: 0px; } +input:disabled, button:disabled { + cursor: not-allowed !important; +} +input[type="submit"]:disabled, button:disabled { + opacity: 0.7; +} \ No newline at end of file diff --git a/services/salix/client/index.ejs b/services/salix/client/index.ejs index f5e210f3f..9caf8950e 100644 --- a/services/salix/client/index.ejs +++ b/services/salix/client/index.ejs @@ -1,11 +1,11 @@ - + Salix - +