X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fgooglemap%2Fstatic%2Fjs%2Fgooglemap.js;h=2feb424ce4b1378420c97a050ad748cabdbbdbfb;hb=9323c1c60dcba3b9447f664019993076ae8e0c35;hp=7346f733e1529062e18d9ea260f0cd7361ad689b;hpb=d88dd4a28b502d57131145b1a8b7d0c3b949d805;p=myslice.git diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js index 7346f733..2feb424c 100644 --- a/plugins/googlemap/static/js/googlemap.js +++ b/plugins/googlemap/static/js/googlemap.js @@ -151,14 +151,16 @@ // retrieve DOM checkbox and make sure it is checked/unchecked set_checkbox_from_record: function(record, checked) { var init_id=record[this.init_key]; - var checkbox = this.by_id [ init_id ]; - checkbox.prop('checked',checked); + var checkbox = this.by_init_id [ init_id ]; + if (checkbox) checkbox.prop('checked',checked); + else this.warning(record, "googlemap.set_checkbox_from_record - not found "+init_id); }, set_checkbox_from_data: function(id, checked) { - var id=record[this.canonical_key]; + var id=record [this.canonical_key]; var checkbox = this.by_id [ id ]; - checkbox.prop('checked',checked); + if (checkbox) checkbox.prop('checked',checked); + else this.warning(record, "googlemap.set_checkbox_from_data - not found "+init_id); }, // this record is *in* the slice