.css("float", this.element.css("float"))\r
.prepend('<div class="ui-spinner-up"></div>')\r
.find("div.ui-spinner-up")\r
- .bind("mousedown", function() { if(!self.counter) self.counter = 1; self.mousedown(100, "up"); })\r
- .bind("mouseup", function(e) { self.counter = 0; if(self.timer) window.clearInterval(self.timer); self.element[0].focus(); self.propagate("change", e); })\r
+ .bind("mousedown", function() { if(!self.counter) self.counter = 1; self._mousedown(100, "_up"); })\r
+ .bind("mouseup", function(e) { self.counter = 0; if(self.timer) window.clearInterval(self.timer); self.element[0].focus(); self._propagate("change", e); })\r
.css({ height: pickerHeight, top: parseInt(this.element.css("borderTopWidth"),10)+1, right: parseInt(this.element.css("borderRightWidth"),10)+1 })\r
.end()\r
.append('<div class="ui-spinner-down"></div>')\r
.find("div.ui-spinner-down")\r
- .bind("mousedown", function() { if(!self.counter) self.counter = 1; self.mousedown(100, "down"); })\r
- .bind("mouseup", function(e) { self.counter = 0; if(self.timer) window.clearInterval(self.timer); self.element[0].focus(); self.propagate("change", e); })\r
+ .bind("mousedown", function() { if(!self.counter) self.counter = 1; self._mousedown(100, "_down"); })\r
+ .bind("mouseup", function(e) { self.counter = 0; if(self.timer) window.clearInterval(self.timer); self.element[0].focus(); self._propagate("change", e); })\r
.css({ height: pickerHeight, bottom: parseInt(this.element.css("borderBottomWidth"),10)+1, right: parseInt(this.element.css("borderRightWidth"),10)+1 })\r
.end()\r
;\r
this.element\r
.bind("keydown.spinner", function(e) {\r
if(!self.counter) self.counter = 1;\r
- self.keydown.call(self, e);\r
+ self._keydown.call(self, e);\r
})\r
.bind("keyup.spinner", function(e) {\r
self.counter = 0;\r
- self.cleanUp();\r
- self.propagate("change", e);\r
+ self._cleanUp();\r
+ self._propagate("change", e);\r
})\r
;\r
if ($.fn.mousewheel) {\r
- this.element.mousewheel(function(e, delta) { self.mousewheel(e, delta); });\r
+ this.element.mousewheel(function(e, delta) { self._mousewheel(e, delta); });\r
}\r
\r
},\r
plugins: {},\r
- constrain: function() {\r
+ _constrain: function() {\r
if(this.options.min != undefined && this.element[0].value < this.options.min) this.element[0].value = this.options.min;\r
if(this.options.max != undefined && this.element[0].value > this.options.max) this.element[0].value = this.options.max;\r
},\r
- cleanUp: function() {\r
+ _cleanUp: function() {\r
this.element[0].value = this.element[0].value.replace(/[^0-9\-]/g, '');\r
- this.constrain();\r
+ this._constrain();\r
},\r
- down: function(e) {\r
+ _down: function(e) {\r
if(isNaN(parseInt(this.element[0].value,10))) this.element[0].value = this.options.start;\r
this.element[0].value -= (this.options.incremental && this.counter > 100 ? (this.counter > 200 ? 100 : 10) : 1) * this.options.stepping;\r
- this.constrain();\r
+ this._constrain();\r
if(this.counter) this.counter++;\r
- this.propagate("spin", e);\r
+ this._propagate("spin", e);\r
},\r
- up: function(e) {\r
+ _up: function(e) {\r
if(isNaN(parseInt(this.element[0].value,10))) this.element[0].value = this.options.start;\r
this.element[0].value = parseFloat(this.element[0].value) + (this.options.incremental && this.counter > 100 ? (this.counter > 200 ? 100 : 10) : 1) * this.options.stepping;\r
- this.constrain();\r
+ this._constrain();\r
if(this.counter) this.counter++;\r
- this.propagate("spin", e);\r
+ this._propagate("spin", e);\r
},\r
- mousedown: function(i, d) {\r
+ _mousedown: function(i, d) {\r
var self = this;\r
i = i || 100;\r
if(this.timer) window.clearInterval(this.timer);\r
this.timer = window.setInterval(function() {\r
self[d]();\r
- if(self.counter > 20) self.mousedown(20, d);\r
+ if(self.counter > 20) self._mousedown(20, d);\r
}, i);\r
},\r
- keydown: function(e) {\r
- if(e.keyCode == 38 || e.keyCode == 39) this.up(e);\r
- if(e.keyCode == 40 || e.keyCode == 37) this.down(e);\r
+ _keydown: function(e) {\r
+ if(e.keyCode == 38 || e.keyCode == 39) this._up(e);\r
+ if(e.keyCode == 40 || e.keyCode == 37) this._down(e);\r
if(e.keyCode == 36) this.element[0].value = this.options.min || this.options.start; //Home key goes to min, if defined, else to start\r
if(e.keyCode == 35 && this.options.max != undefined) this.element[0].value = this.options.max; //End key goes to maximum\r
},\r
- mousewheel: function(e, delta) {\r
+ _mousewheel: function(e, delta) {\r
delta = ($.browser.opera ? -delta / Math.abs(delta) : delta);\r
- delta > 0 ? this.up(e) : this.down(e);\r
+ delta > 0 ? this._up(e) : this._down(e);\r
e.preventDefault();\r
},\r
ui: function(e) {\r
element: this.element \r
};\r
},\r
- propagate: function(n,e) {\r
+ _propagate: function(n,e) {\r
$.ui.plugin.call(this, n, [e, this.ui()]);\r
return this.element.triggerHandler(n == "spin" ? n : "spin"+n, [e, this.ui()], this.options[n]);\r
},\r