Jonas Kress (WMDE) has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/277088

Change subject: Lazyload map marker popup content
......................................................................

Lazyload map marker popup content

Change-Id: I8b53b757f186a94eca1d07e9bfc38c5147cfed2e
---
M wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
1 file changed, 10 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/query/gui 
refs/changes/88/277088/1

diff --git a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js 
b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
index fb71ee9..2ba9668 100644
--- a/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
+++ b/wikibase/queryService/ui/resultBrowser/CoordinateResultBrowser.js
@@ -82,16 +82,21 @@
                                        if( !longLat[0] || !longLat[1] || 
isNaN( longLat[0] ) ){
                                        return true;
                                }
-                               var info = self._getItemDescription( rowKey );
 
-                               markers.push(
-                                               L.circle( [ longLat[0], 
longLat[1] ], 50, {
+                                   var popup = L.popup(),
+                                       marker = L.circle( [ longLat[0], 
longLat[1] ], 50, {
                                                        color: '#e04545',
                                                        opacity: 0.9,
                                                        fillColor: '#e04545',
                                                        fillOpacity: 0.9
-                                               } ).bindPopup( info[0] )
-                                       );
+                                               } ).bindPopup( popup );
+
+                               marker.on( 'click', function() {
+                                       var info = self._getItemDescription( 
rowKey );
+                                       popup.setContent( info[0] );
+                               } );
+
+                               markers.push( marker );
                        }
                        } );
                } );

-- 
To view, visit https://gerrit.wikimedia.org/r/277088
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b53b757f186a94eca1d07e9bfc38c5147cfed2e
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/query/gui
Gerrit-Branch: master
Gerrit-Owner: Jonas Kress (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to