aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-09-25 21:18:57 +0200
committerFelix Nagel <info@felixnagel.com>2013-09-25 21:18:57 +0200
commitde4e863552b75aca84d0c5a380243142c6e9baf2 (patch)
tree9fe159d8fde8ca72e4e4777dc2e6f116b0a28096 /ui
parent4ddd14fe43fd0539b4d886db6a4c874c993e8739 (diff)
parent134fcafddac25b8e81160718fec59c39e7c76c59 (diff)
downloadjquery-ui-de4e863552b75aca84d0c5a380243142c6e9baf2.tar.gz
jquery-ui-de4e863552b75aca84d0c5a380243142c6e9baf2.zip
Merge branch 'selectmenu' of github.com:jquery/jquery-ui into selectmenu
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.spinner.js12
-rw-r--r--ui/jquery.ui.widget.js13
2 files changed, 22 insertions, 3 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index c022413dc..a4912fc7e 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -418,6 +418,18 @@ $.widget( "ui.spinner", {
});
},
+ isValid: function() {
+ var value = this.value();
+
+ // null is invalid
+ if ( value === null ) {
+ return false;
+ }
+
+ // if value gets adjusted, it's invalid
+ return value === this._adjustValue( value );
+ },
+
// update the value without triggering change
_value: function( value, allowAny ) {
var parsed;
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 885e2019f..a46dcaf99 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -203,7 +203,10 @@ $.widget.bridge = function( name, object ) {
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
- instance.option( options || {} )._init();
+ instance.option( options || {} );
+ if ( instance._init ) {
+ instance._init();
+ }
} else {
$.data( this, fullName, new object( options, this ) );
}
@@ -349,8 +352,12 @@ $.Widget.prototype = {
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
- this.hoverable.removeClass( "ui-state-hover" );
- this.focusable.removeClass( "ui-state-focus" );
+
+ // If the widget is becoming disabled, then nothing is interactive
+ if ( value ) {
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
}
return this;