[Mapbender-commits] r10340 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Nov 19 02:26:48 PST 2019


Author: armin11
Date: 2019-11-19 02:26:48 -0800 (Tue, 19 Nov 2019)
New Revision: 10340

Modified:
   trunk/mapbender/http/plugins/mod_metadataCarousel.php
Log:
Fix click events - deactivate them on <li> - user div instead

Modified: trunk/mapbender/http/plugins/mod_metadataCarousel.php
===================================================================
--- trunk/mapbender/http/plugins/mod_metadataCarousel.php	2019-11-19 09:54:12 UTC (rev 10339)
+++ trunk/mapbender/http/plugins/mod_metadataCarousel.php	2019-11-19 10:26:48 UTC (rev 10340)
@@ -121,13 +121,13 @@
         //increase global var currentPage
         currentPage = parseInt(currentPage) + parseInt(1);
         //unbind all old click events
-        $('.slides li img').unbind('click');
+        $('.slide_div').unbind('click');
         //reinitialize click event
-        $('.slides li img').click(function(){
+        $('.slide_div').click(function(){
             var $this = $(this);
-            resourceId = $this.attr("resourceId");
+            resourceId = $this.attr("resourceid");
             resourceTitle = $this.attr("title");
-            alert(options.loadMessage + ": " + resourceId);
+            alert(options.loadMessage + ": " + resourceTitle);
             that.executeJavaScript({method:"loadWmc", parameters:{id:resourceId}});
         });
     }});
@@ -155,13 +155,14 @@
         slideshow: false,
         //isFirefox: true,
         start: function(slider){
-            $('.slides li img', slider).click(function(){
+            $('.slide_div').click(function(){
                 var $this = $(this);
-                resourceId = $this.attr("resourceId"); 
+                resourceId = $this.attr("resourceid"); 
                 resourceTitle = $this.attr("title"); 
 		alert(options.loadMessage + ": " + resourceTitle);
                 that.loadWmcById(resourceId);
             });
+            $('.slide').unbind('click');
         },
         end: function(slider){
             that.loadMore();
@@ -185,6 +186,7 @@
         $("ul.slides").html("");
         //alert("number of all wmc: "+JSON.parse(initialResult.responseText).wmc.md.nresults);
         JSON.parse(initialResult.responseText).wmc.srv.forEach(that.addElementToSlider);
+        $('.slide').unbind('click');
         /*$('.show_more_button').attr("value", "1-"+parseInt(currentPage)*parseInt(maxResults)+" ("+numberOfResults+") - "+showMoreButtonText);
         if (parseInt(currentPage)*parseInt(maxResults) >= parseInt(numberOfResults)) {
             $('.show_more_button').attr("value", "1-"+numberOfResults+" ("+numberOfResults+")");
@@ -193,7 +195,7 @@
     }
 
     this.addElementToSlider = function(item) {
-	mainFlexSlider.data('flexslider').addSlide("<li class='slide'><div class='slide_div'><img src='"+item.previewURL+"' resourceId='"+item.id+"' title='"+item.title+"'/><div><span class='flex-caption'>"+item.title+"</span></div><div><span class='flex-load-count'>"+item.loadCount+"</span></div></div></li>");
+	mainFlexSlider.data('flexslider').addSlide("<li class='slide'><div class='slide_div' resourceId='"+item.id+"' title='"+item.title+"'><img src='"+item.previewURL+"' resourceId='"+item.id+"' title='"+item.title+"'/><div><span class='flex-caption'>"+item.title+"</span></div><div><span class='flex-load-count'>"+item.loadCount+"</span></div></div></li>");
     }
 
     this.removeOldContainer = function(){



More information about the Mapbender_commits mailing list