Merge branch '2135-hotfix_acl_disabled_input' of verdnatura/salix into dev
gitea/salix/dev This commit looks good
Details
gitea/salix/dev This commit looks good
Details
This commit is contained in:
commit
6533cf095c
|
@ -29,10 +29,12 @@ export default class Button extends FormInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
onClick(event) {
|
onClick(event) {
|
||||||
if (this.disabled)
|
if (this.disabled) {
|
||||||
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Button.$inject = ['$element', '$scope'];
|
Button.$inject = ['$element', '$scope'];
|
||||||
|
|
||||||
ngModule.vnComponent('vnButton', {
|
ngModule.vnComponent('vnButton', {
|
||||||
|
|
|
@ -14,10 +14,13 @@ export function directive($parse) {
|
||||||
const cb = $parse($attrs.vnHttpClick);
|
const cb = $parse($attrs.vnHttpClick);
|
||||||
const element = $element[0];
|
const element = $element[0];
|
||||||
$element.on('click', () => {
|
$element.on('click', () => {
|
||||||
element.$ctrl.disabled = true;
|
const controller = element.$ctrl;
|
||||||
|
controller.$oldDisabled = field.$ctrl.disabled;
|
||||||
|
controller.disabled = true;
|
||||||
|
|
||||||
cb($scope).finally(() => {
|
cb($scope).finally(() => {
|
||||||
element.$ctrl.disabled = false;
|
if (!controller.$oldDisabled)
|
||||||
|
controller.disabled = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,16 @@ export function directive($parse) {
|
||||||
const fields = angular.element(elements);
|
const fields = angular.element(elements);
|
||||||
|
|
||||||
angular.forEach(fields, field => {
|
angular.forEach(fields, field => {
|
||||||
field.$ctrl.disabled = true;
|
const controller = field.$ctrl;
|
||||||
|
controller.$oldDisabled = controller.disabled;
|
||||||
|
controller.disabled = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
cb($scope).finally(() => {
|
cb($scope).finally(() => {
|
||||||
angular.forEach(fields, field => {
|
angular.forEach(fields, field => {
|
||||||
field.$ctrl.disabled = false;
|
const controller = field.$ctrl;
|
||||||
|
if (!controller.$oldDisabled)
|
||||||
|
controller.disabled = false;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue