From 9323c1c60dcba3b9447f664019993076ae8e0c35 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 12 Dec 2013 15:24:37 +0100 Subject: [PATCH] various fixes for querytable and googlemap display is hostname-based now could be made hrn again very simply internal communication is urn-based should work fine now --- plugins/googlemap/__init__.py | 6 +++++- plugins/googlemap/static/js/googlemap.js | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/googlemap/__init__.py b/plugins/googlemap/__init__.py index 8ceaec63..583b8dd5 100644 --- a/plugins/googlemap/__init__.py +++ b/plugins/googlemap/__init__.py @@ -44,4 +44,8 @@ class GoogleMap (Plugin): return reqs # the list of things passed to the js plugin - def json_settings_list (self): return ['plugin_uuid','query_uuid', 'query_all_uuid', 'latitude', 'longitude', 'zoom', ] + def json_settings_list (self): + return [ 'plugin_uuid', 'query_uuid', 'query_all_uuid', + 'init_key', + 'latitude', 'longitude', 'zoom', + ] 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 -- 2.43.0