Añadidos estilos a elementos desabilitados, mejora de directiva vnAcl
This commit is contained in:
parent
041be5ec93
commit
571692f4ca
|
@ -38,5 +38,5 @@
|
|||
<tpl-buttons>
|
||||
<button response="CANCEL" translate>Cancel</button>
|
||||
<button response="ACCEPT" translate>Change password</button>
|
||||
</tpl-body>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<html ng-app="salix">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Salix</title>
|
||||
<script src="/salix/acl"></script>
|
||||
</head>
|
||||
<body ng-app="salix">
|
||||
<body>
|
||||
<vn-app></vn-app>
|
||||
<script type="text/javascript"
|
||||
src="/static/routes.js">
|
||||
|
|
Loading…
Reference in New Issue