Changeset 5136
- Timestamp:
- 03/28/08 11:51:31 (10 months ago)
- Location:
- trunk/ui
- Files:
-
- 2 modified
-
ui.base.js (modified) (4 diffs)
-
ui.slider.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ui/ui.base.js
r5134 r5136 132 132 || (this.options.condition && !this.options.condition.apply(this.options.executor || this, [e, this.element])) //Prevent execution on condition 133 133 ) return true; 134 134 135 135 var self = this; 136 136 var initialize = function() { … … 138 138 $(document).bind('mouseup.draggable', function() { return self.stop.apply(self, arguments); }); 139 139 $(document).bind('mousemove.draggable', function() { return self.drag.apply(self, arguments); }); 140 141 if(!self.initalized && Math.abs(self._MP.left-e.pageX) >= self.options.distance || Math.abs(self._MP.top-e.pageY) >= self.options.distance) { 142 if(self.options.start) self.options.start.call(self.options.executor || self, e, self.element); 143 self.initialized = true; 144 } 140 145 }; 141 146 … … 146 151 initialize(); 147 152 } 148 153 149 154 return false; 150 155 … … 166 171 if ($.browser.msie && !e.button) return this.stop.apply(this, [e]); // IE mouseup check 167 172 168 if(!this.initialized && (Math.abs(this._MP.left-e.pageX) >= o.distance || Math.abs(this._MP.top-e.pageY) >= o.distance)) { 173 if(!this.initialized && (Math.abs(this._MP.left-e.pageX) >= o.distance || Math.abs(this._MP.top-e.pageY) >= o.distance)) { 169 174 if(this.options.start) this.options.start.call(this.options.executor || this, e, this.element); 170 175 this.initialized = true; -
trunk/ui/ui.slider.js
r5134 r5136 76 76 } 77 77 }) 78 .wrap('<a href="javascript:void(0)" ></a>')78 .wrap('<a href="javascript:void(0)" style="cursor:default;"></a>') 79 79 .parent() 80 80 .bind('focus', function(e) { self.focus(this.firstChild); }) … … 87 87 ; 88 88 89 //Position the node90 if(o.helper == 'original' && (this.element.css('position') == 'static' || this.element.css('position') == '')) this.element.css('position', 'relative');91 92 89 //Prepare dynamic properties for later use 93 90 if(o.axis == 'horizontal') { … … 100 97 101 98 //Bind the click to the slider itself 102 this.element.bind('click.slider', function(e) { self.click.apply(self, [e]); }); 99 this.element.bind('mousedown.slider', function(e) { 100 self.click.apply(self, [e]); 101 self.currentHandle.data("ui-mouse").trigger(e); 102 }); 103 103 104 104 //Move the first handle to the startValue … … 207 207 //Move focussed handle to the clicked position 208 208 this.offset = this.element.offset(); 209 this.moveTo(this.convertValue(e[this.properties[0] == 'top' ? 'pageY' : 'pageX'] - this.offset[this.properties[0]] - this.handleSize()/2) );209 this.moveTo(this.convertValue(e[this.properties[0] == 'top' ? 'pageY' : 'pageX'] - this.offset[this.properties[0]] - this.handleSize()/2), null, true); 210 210 }, 211 211 start: function(e, handle) { 212 212 213 213 var o = this.options; 214 214 if(!this.currentHandle) this.currentHandle = this.previousHandle; //This is a especially ugly fix for strange blur events happening on mousemove events 215 215 216 this.offset = this.element.offset(); 216 217 this.handleOffset = this.currentHandle.offset(); … … 266 267 var o = this.options; 267 268 var position = { top: e.pageY - this.offset.top - this.clickOffset.top, left: e.pageX - this.offset.left - this.clickOffset.left}; 269 if(!this.currentHandle) this.currentHandle = this.previousHandle; //This is a especially ugly fix for strange blur events happening on mousemove events 268 270 269 271 var modifier = position[this.properties[0]]; … … 278 280 279 281 modifier = this.translateRange(modifier); 280 282 281 283 this.currentHandle.css(this.properties[0], modifier); 282 284 if (this.rangeElement)
