Skip to content

Commit

Permalink
Handle default values in dirty check attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenn Jacobsen committed Oct 1, 2020
1 parent 9a4867d commit 0a5b442
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

function onInit() {
vm.inputId = vm.inputId || "umb-check_" + String.CreateGuid();
vm.disableDirtyCheck = Object.toBoolean(vm.disableDirtyCheck) === true;
vm.disableDirtyCheck = vm.disableDirtyCheck === undefined || Object.toBoolean(vm.disableDirtyCheck) === true;
vm.icon = vm.icon || vm.iconClass || null;

// If a labelKey is passed let's update the returned text if it's does not contain an opening square bracket [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

function onInit() {
vm.inputId = vm.inputId || "umb-radio_" + String.CreateGuid();
vm.disableDirtyCheck = Object.toBoolean(vm.disableDirtyCheck) === true;
vm.disableDirtyCheck = vm.disableDirtyCheck === undefined || Object.toBoolean(vm.disableDirtyCheck) === true;
vm.icon = vm.icon || vm.iconClass || null;

// If a labelKey is passed let's update the returned text if it's does not contain an opening square bracket [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function noDirtyCheck() {
link: function (scope, elm, attrs, ctrl) {

// If no attribute value is "false", then skip and use default behaviour.
var dirtyCheck = Object.toBoolean(attrs.noDirtyCheck) === false;
var dirtyCheck = !!attrs.noDirtyCheck && Object.toBoolean(attrs.noDirtyCheck) === false;
if (dirtyCheck)
return;

Expand Down

0 comments on commit 0a5b442

Please sign in to comment.