fix inconsistency of resources_selected when resources were added/removed from googlemap
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 4 Oct 2013 13:44:51 +0000 (15:44 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Fri, 4 Oct 2013 13:44:51 +0000 (15:44 +0200)
turns out backslashes were getting removed from hrns, which confused the whole business

plugins/googlemap/static/js/googlemap.js

index 3f8ae73..3876e9f 100644 (file)
@@ -101,7 +101,12 @@ googlemap_debug_detailed=false;
                 throw "Not implemented";
                 break;
             }
-           return this.escape_id(key_value).replace(/\\/g, '');
+           // XXX BACKSLASHES original code was reading like this
+           //return this.escape_id(key_value).replace(/\\/g, '');
+           //  however this sequence removes backslashes from hrn's and as a result
+           // resources_selected was getting all mixed up
+           // hazelnut does publish hrn's with backslashes and that seems like the thing to do
+           return key_value;
        },          
 
        // return { marker: gmap_marker, ul : <ul DOM> }
@@ -174,7 +179,9 @@ googlemap_debug_detailed=false;
            var checkbox = this.create_record_checkbox (record, ul, false);
            if ( ! this.key in record ) return;
             var key_value = record[this.key];
-           var hrn = this.escape_id(key_value).replace(/\\/g, '');
+           // see XXX BACKSLASHES 
+           //var hrn = this.escape_id(key_value).replace(/\\/g, '');
+           var hrn = key_value;
             this.by_hrn[hrn] = {
                checkbox: checkbox,
                // xxx Thierry sept 2013