Add disable-dirty-check option

This commit is contained in:
BatJan
2020-05-16 21:00:41 +02:00
committed by Sebastiaan Janssen
parent 62b0886afe
commit 30900c59ae
2 changed files with 19 additions and 4 deletions
@@ -32,6 +32,7 @@
@param {boolean} required Set the checkbox to be required.
@param {callback} onChange Callback when the value of the checkbox change by interaction.
@param {string} cssClass Set a css class modifier
@param {boolean} disableDirtyCheck Disable checking if the model is dirty
**/
@@ -84,7 +85,8 @@
required: "<",
onChange: "&?",
cssClass: "@?",
iconClass: "@?"
iconClass: "@?",
disableDirtyCheck: "=?"
}
};
@@ -1,7 +1,7 @@
<label class="checkbox umb-form-check umb-form-check--checkbox {{vm.cssClass}}" ng-class="{ 'umb-form-check--disabled': vm.disabled }">
<div class="umb-form-check__symbol">
<input type="checkbox"
<input ng-if="vm.disableDirtyCheck"
type="checkbox"
id="{{vm.inputId}}"
name="{{vm.name}}"
value="{{vm.value}}"
@@ -10,7 +10,20 @@
ng-model="vm.model"
ng-disabled="vm.disabled"
ng-required="vm.required"
ng-change="vm.change()"/>
ng-change="vm.change()"
no-dirty-check />
<input ng-if="!vm.disableDirtyCheck"
type="checkbox"
id="{{vm.inputId}}"
name="{{vm.name}}"
value="{{vm.value}}"
class="umb-form-check__input"
val-server-field="{{vm.serverValidationField}}"
ng-model="vm.model"
ng-disabled="vm.disabled"
ng-required="vm.required"
ng-change="vm.change()"/>
<span class="umb-form-check__state" aria-hidden="true">
<span class="umb-form-check__check">