[OpenLayers-Commits] r11403 -
sandbox/camptocamp/mobile/openlayers/examples
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Thu Feb 24 06:21:46 EST 2011
Author: pgiraud
Date: 2011-02-24 03:21:46 -0800 (Thu, 24 Feb 2011)
New Revision: 11403
Modified:
sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js
Log:
listen to click on the hyperlink, not on the list, so that it is fired only once
Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js 2011-02-24 11:13:41 UTC (rev 11402)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js 2011-02-24 11:21:46 UTC (rev 11403)
@@ -114,16 +114,17 @@
})
.append($('<a />', {
text: layer.name
- }))
- .appendTo('#layerslist')
- .click(function() {
- $.mobile.changePage('mappage');
- if (layer.isBaseLayer) {
- layer.map.setBaseLayer(layer);
- } else {
- layer.setVisibility(!layer.visibility);
- }
- });
+ })
+ .click(function() {
+ $.mobile.changePage('mappage');
+ if (layer.isBaseLayer) {
+ layer.map.setBaseLayer(layer);
+ } else {
+ layer.setVisibility(!layer.getVisibility());
+ }
+ })
+ )
+ .appendTo('#layerslist');
layer.events.on({
'visibilitychanged': function() {
$(item).toggleClass('checked');
More information about the Commits
mailing list