Incorporating review comments from @jorix.

This commit is contained in:
ahocevar
2012-01-22 13:03:56 +01:00
parent e7107b96cb
commit ed88941280

View File

@@ -47,12 +47,6 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
*/ */
zoombarDiv: null, zoombarDiv: null,
/**
* Property: divEvents
* {<OpenLayers.Events>}
*/
divEvents: null,
/** /**
* APIProperty: zoomWorldIcon * APIProperty: zoomWorldIcon
* {Boolean} * {Boolean}
@@ -212,9 +206,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
"touchend": this.zoomBarUp, "touchend": this.zoomBarUp,
"mousedown": this.zoomBarDown, "mousedown": this.zoomBarDown,
"mousemove": this.zoomBarDrag, "mousemove": this.zoomBarDrag,
"mouseup": this.zoomBarUp, "mouseup": this.zoomBarUp
"dblclick": this.doubleClick,
"click": this.doubleClick
}); });
var sz = { var sz = {
@@ -259,15 +251,15 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
*/ */
_removeZoomBar: function() { _removeZoomBar: function() {
this.sliderEvents.un({ this.sliderEvents.un({
"touchstart": this.zoomBarDown,
"touchmove": this.zoomBarDrag, "touchmove": this.zoomBarDrag,
"touchend": this.zoomBarUp,
"mousedown": this.zoomBarDown, "mousedown": this.zoomBarDown,
"mousemove": this.zoomBarDrag, "mousemove": this.zoomBarDrag,
"mouseup": this.zoomBarUp, "mouseup": this.zoomBarUp
"dblclick": this.doubleClick,
"click": this.doubleClick
}); });
this.sliderEvents.destroy(); this.sliderEvents.destroy();
this.div.removeChild(this.zoombarDiv); this.div.removeChild(this.zoombarDiv);
this.zoombarDiv = null; this.zoombarDiv = null;
this.div.removeChild(this.slider); this.div.removeChild(this.slider);
@@ -278,6 +270,9 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
/** /**
* Method: onButtonClick * Method: onButtonClick
*
* Parameters:
* evt - {Event}
*/ */
onButtonClick: function(evt) { onButtonClick: function(evt) {
OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this, arguments); OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this, arguments);
@@ -292,6 +287,18 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
} }
}, },
/**
* Method: passEventToSlider
* This function is used to pass events that happen on the div, or the map,
* through to the slider, which then does its moving thing.
*
* Parameters:
* evt - {<OpenLayers.Event>}
*/
passEventToSlider:function(evt) {
this.sliderEvents.handleBrowserEvent(evt);
},
/* /*
* Method: zoomBarDown * Method: zoomBarDown
* event listener for clicks on the slider * event listener for clicks on the slider
@@ -392,4 +399,4 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
}, },
CLASS_NAME: "OpenLayers.Control.PanZoomBar" CLASS_NAME: "OpenLayers.Control.PanZoomBar"
}); });