// button bindings\r
this.buttons = uiSpinner.find('.ui-spinner-button')\r
.attr("tabIndex", -1)\r
+ .button()\r
+ .first()\r
+ .removeClass("ui-corner-all")\r
+ .end()\r
+ .last()\r
+ .removeClass("ui-corner-all")\r
+ .end()\r
.bind('mousedown', function(event) { \r
if (self._start(event) === false) {\r
return false;\r
}\r
self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event);\r
- \r
- if (!self.options.disabled) {\r
- $(this).addClass(active);\r
- uiSpinner.addClass(active);\r
- }\r
})\r
.bind('mouseup', function(event) {\r
if (self.counter == 1) {\r
self._stop(event);\r
self._change(event); \r
}\r
- $(this).removeClass(active);\r
})\r
- .hover(function() {\r
- if (!self.options.disabled) {\r
- $(this).addClass(hover); \r
+ .bind("mouseenter", function() {\r
+ // button will add ui-state-active if mouse was down while mouseleave and kept down\r
+ if ($(this).hasClass("ui-state-active")) {\r
+ if (self._start(event) === false) {\r
+ return false;\r
+ }\r
+ self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event);\r
}\r
- }, function(event) {\r
- $(this).removeClass(active + ' ' + hover);\r
+ })\r
+ .bind("mouseleave", function() {\r
if (self.timer && self.spinning) {\r
self._stop(event);\r
self._change(event);\r
}\r
- });\r
+ })\r
\r
self.uiSpinner = uiSpinner;\r
},\r
'"></div>';\r
},\r
_buttonHtml: function() {\r
- return '<a class="ui-spinner-button ui-spinner-up ui-state-default ui-corner-t' + this.options.dir.substr(-1,1) + \r
+ return '<a class="ui-spinner-button ui-spinner-up ui-corner-t' + this.options.dir.substr(-1,1) + \r
'"><span class="ui-icon ui-icon-triangle-1-n">▲</span></a>' +\r
- '<a class="ui-spinner-button ui-spinner-down ui-state-default ui-corner-b' + this.options.dir.substr(-1,1) + \r
+ '<a class="ui-spinner-button ui-spinner-down ui-corner-b' + this.options.dir.substr(-1,1) + \r
'"><span class="ui-icon ui-icon-triangle-1-s">▼</span></a>';\r
},\r
_start: function(event) {\r