Changeset 397
- Timestamp:
- 05/26/06 08:16:02 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js
r388 r397 87 87 } 88 88 89 this.zoombarDiv = div; 90 89 91 this.divEvents = new OpenLayers.Events(this, div); 90 92 this.divEvents.register("mousedown", this, this.divClick); 91 this.divEvents.register("mousemove", this, this. zoomBarDivDrag);93 this.divEvents.register("mousemove", this, this.passEventToSlider); 92 94 this.divEvents.register("dblclick", this, this.doubleClick); 93 95 … … 110 112 }, 111 113 zoomBarDown:function(evt) { 112 this.map.events.register("mousemove", this, this. mapMouseDrag);113 this.map.events.register("mouseup", this, this. mapMouseUp);114 this.map.events.register("mousemove", this, this.passEventToSlider); 115 this.map.events.register("mouseup", this, this.passEventToSlider); 114 116 this.mouseDragStart = evt.xy.copyOf(); 115 117 this.zoomStart = evt.xy.copyOf(); … … 117 119 Event.stop(evt); 118 120 }, 119 mapMouseDrag:function(evt) { 120 this.sliderEvents.handleBrowserEvent(evt); 121 }, 122 mapMouseUp:function(evt) { 123 this.sliderEvents.handleBrowserEvent(evt); 124 }, 125 zoomBarDivDrag: function(evt) { 121 passEventToSlider:function(evt) { 126 122 this.sliderEvents.handleBrowserEvent(evt); 127 123 }, … … 129 125 if (this.mouseDragStart != null) { 130 126 var deltaY = this.mouseDragStart.y - evt.xy.y 131 this.slider.style.top = (parseInt(this.slider.style.top)-deltaY)+"px"; 127 var offsets = Position.page(this.zoombarDiv); 128 if ((evt.clientY - offsets[1]) > 0 && 129 (evt.clientY - offsets[1]) < parseInt(this.zoombarDiv.style.height) - 2) { 130 var newTop = parseInt(this.slider.style.top) - deltaY; 131 this.slider.style.top = newTop+"px"; 132 } 132 133 this.mouseDragStart = evt.xy.copyOf(); 133 134 }
