Skip to content

Commit

Permalink
Fix ControlMultipleChecks control
Browse files Browse the repository at this point in the history
  • Loading branch information
UmSenhorQualquer committed Apr 10, 2019
1 parent eb779af commit 7f0e0d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pyforms_web/web/static/pyforms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyforms_web/web/static/pyformsjs/ControlMultipleChecks.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ControlMultipleChecks extends ControlBase{
this.flag_exec_on_change_event = false;
if(value==null || value==undefined || value.length==0){
$("#"+this.place_id()+' .ui.checkbox').checkbox('uncheck');
this.flag_exec_on_change_event = true;
return;
};
for(var i=0; i<this.properties.items.length; i++){
Expand Down Expand Up @@ -38,6 +39,7 @@ class ControlMultipleChecks extends ControlBase{
////////////////////////////////////////////////////////////////////////////////

init_control(){

var html = "<div class='field control ControlMultipleChecks' id='"+this.place_id()+"' >";
if(this.properties.label_visible) html += "<label for='"+this.control_id()+"'>"+this.properties.label+"</label>";

Expand All @@ -59,7 +61,7 @@ class ControlMultipleChecks extends ControlBase{
this.jquery_place().replaceWith(html);
this.set_value(this.properties.value);

this.flag_exec_on_change_event = true;
var self = this;
$("#"+this.place_id()+' .ui.checkbox').checkbox({
onChange:function(){
if(self.flag_exec_on_change_event)
Expand Down

0 comments on commit 7f0e0d9

Please sign in to comment.