Skip to content

Commit

Permalink
Item12952: Fix setting of pending boolean
Browse files Browse the repository at this point in the history
The javascript coded to set a checkbox is passed either true or false,
not "checked" or "".
  • Loading branch information
gac410 committed Sep 3, 2014
1 parent d14048d commit 160636e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions pub/System/ConfigurePlugin/types.uncompressed.js
Expand Up @@ -98,15 +98,15 @@ var Types = {};
if (typeof(change_handler) !== "undefined") {
this.$ui.change(change_handler);
}
if (typeof(this.spec.current_value) === 'undefined')
if (typeof(this.spec.current_value) == 'undefined')
this.spec.current_value = 0;
else if (this.spec.current_value === '0')
else if (this.spec.current_value == '0')
this.spec.current_value = 0;
else if (this.spec.current_value === '1')
else if (this.spec.current_value == '1')
this.spec.current_value = 1;

if (this.spec.current_value !== 0) {
this.$ui.attr('checked', 'checked');
if (this.spec.current_value != 0) {
this.$ui.attr('checked', true);
}
if (this.spec.extraClass) {
this.$ui.addClass(this.spec.extraClass);
Expand All @@ -131,7 +131,13 @@ var Types = {};
},

useVal: function(val) {
this.$ui.attr('checked', val ? 'checked' : '');
if (typeof(val) == 'undefined')
val = false;
else if (val == '0')
val = false;
else if ( val == '1')
val = true;
this.$ui.attr('checked', val );
}
});

Expand Down

0 comments on commit 160636e

Please sign in to comment.