-/*! jQuery UI - v1.9.1 - 2012-11-16
+/*! jQuery UI - v1.9.2 - 2012-11-23
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.ui.progressbar.js, jquery.ui.tabs.js
* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
}
$.extend( $.ui, {
- version: "1.9.1",
+ version: "1.9.2",
keyCode: {
BACKSPACE: 8,
}
});
-// support: jQuery <1.8
-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
- $.each( [ "Width", "Height" ], function( i, name ) {
- var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
- type = name.toLowerCase(),
- orig = {
- innerWidth: $.fn.innerWidth,
- innerHeight: $.fn.innerHeight,
- outerWidth: $.fn.outerWidth,
- outerHeight: $.fn.outerHeight
- };
-
- function reduce( elem, size, border, margin ) {
- $.each( side, function() {
- size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
- if ( border ) {
- size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
- }
- if ( margin ) {
- size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
- }
- });
- return size;
- }
-
- $.fn[ "inner" + name ] = function( size ) {
- if ( size === undefined ) {
- return orig[ "inner" + name ].call( this );
- }
-
- return this.each(function() {
- $( this ).css( type, reduce( this, size ) + "px" );
- });
- };
-
- $.fn[ "outer" + name] = function( size, margin ) {
- if ( typeof size !== "number" ) {
- return orig[ "outer" + name ].call( this, size );
- }
-
- return this.each(function() {
- $( this).css( type, reduce( this, size, true, margin ) + "px" );
- });
- };
- });
-}
-
// selectors
function focusable( element, isTabIndexNotNaN ) {
var map, mapName, img,
body.removeChild( div ).style.display = "none";
});
+// support: jQuery <1.8
+if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
+ $.each( [ "Width", "Height" ], function( i, name ) {
+ var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
+ type = name.toLowerCase(),
+ orig = {
+ innerWidth: $.fn.innerWidth,
+ innerHeight: $.fn.innerHeight,
+ outerWidth: $.fn.outerWidth,
+ outerHeight: $.fn.outerHeight
+ };
+
+ function reduce( elem, size, border, margin ) {
+ $.each( side, function() {
+ size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
+ if ( border ) {
+ size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
+ }
+ if ( margin ) {
+ size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
+ }
+ });
+ return size;
+ }
+
+ $.fn[ "inner" + name ] = function( size ) {
+ if ( size === undefined ) {
+ return orig[ "inner" + name ].call( this );
+ }
+
+ return this.each(function() {
+ $( this ).css( type, reduce( this, size ) + "px" );
+ });
+ };
+
+ $.fn[ "outer" + name] = function( size, margin ) {
+ if ( typeof size !== "number" ) {
+ return orig[ "outer" + name ].call( this, size );
+ }
+
+ return this.each(function() {
+ $( this).css( type, reduce( this, size, true, margin ) + "px" );
+ });
+ };
+ });
+}
+
+// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
+if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
+ $.fn.removeData = (function( removeData ) {
+ return function( key ) {
+ if ( arguments.length ) {
+ return removeData.call( this, $.camelCase( key ) );
+ } else {
+ return removeData.call( this );
+ }
+ };
+ })( $.fn.removeData );
+}
+
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
- widgetEventPrefix: basePrototype.widgetEventPrefix || name
+ widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
}, prototype, {
constructor: constructor,
namespace: namespace,
};
$.widget.bridge = function( name, object ) {
- var fullName = object.prototype.widgetFullName;
+ var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = slice.call( arguments, 1 ),
if ( instance ) {
instance.option( options || {} )._init();
} else {
- new object( options, this );
+ $.data( this, fullName, new object( options, this ) );
}
});
}
// TODO remove dual storage
$.data( element, this.widgetName, this );
$.data( element, this.widgetFullName, this );
- this._on( this.element, {
+ this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
return this._setOption( "disabled", true );
},
- _on: function( element, handlers ) {
+ _on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
+
+ // no suppressDisabledCheck flag, shuffle arguments
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
+ handlers = element;
+ element = suppressDisabledCheck;
+ suppressDisabledCheck = false;
+ }
+
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
- if ( instance.options.disabled === true ||
- $( this ).hasClass( "ui-state-disabled" ) ) {
+ if ( !suppressDisabledCheck &&
+ ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
});
$.widget("ui.mouse", {
- version: "1.9.1",
+ version: "1.9.2",
options: {
cancel: 'input,textarea,button,select,option',
distance: 1,
(function( $, undefined ) {
$.widget("ui.draggable", $.ui.mouse, {
- version: "1.9.1",
+ version: "1.9.2",
widgetEventPrefix: "drag",
options: {
addClasses: true,
(function( $, undefined ) {
$.widget("ui.droppable", {
- version: "1.9.1",
+ version: "1.9.2",
widgetEventPrefix: "drop",
options: {
accept: '*',
(function( $, undefined ) {
$.widget("ui.resizable", $.ui.mouse, {
- version: "1.9.1",
+ version: "1.9.2",
widgetEventPrefix: "resize",
options: {
alsoResize: false,
(function( $, undefined ) {
$.widget("ui.selectable", $.ui.mouse, {
- version: "1.9.1",
+ version: "1.9.2",
options: {
appendTo: 'body',
autoRefresh: true,
(function( $, undefined ) {
$.widget("ui.sortable", $.ui.mouse, {
- version: "1.9.1",
+ version: "1.9.2",
widgetEventPrefix: "sort",
ready: false,
options: {
(function( $, undefined ) {
$.widget( "ui.progressbar", {
- version: "1.9.1",
+ version: "1.9.2",
options: {
value: 0,
max: 100
function isLocal( anchor ) {
return anchor.hash.length > 1 &&
- anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
+ anchor.href.replace( rhash, "" ) ===
+ location.href.replace( rhash, "" )
+ // support: Safari 5.1
+ // Safari 5.1 doesn't encode spaces in window.location
+ // but it does encode spaces from anchors (#8777)
+ .replace( /\s/g, "%20" );
}
$.widget( "ui.tabs", {
- version: "1.9.1",
+ version: "1.9.2",
delay: 300,
options: {
active: null,
}
});
+ this.panels.show();
+
if ( this.options.heightStyle !== "content" ) {
this.panels.css( "height", "" );
}
}
},
_trigger: function( type, event, data ) {
- var ret = this._superApply( arguments );
+ var tab, panel,
+ ret = this._superApply( arguments );
+
if ( !ret ) {
return false;
}
- if ( type === "beforeActivate" && data.newTab.length ) {
+
+ if ( type === "beforeActivate" ) {
+ tab = data.newTab.length ? data.newTab : data.oldTab;
+ panel = data.newPanel.length ? data.newPanel : data.oldPanel;
ret = this._super( "select", event, {
- tab: data.newTab.find( ".ui-tabs-anchor" )[ 0],
- panel: data.newPanel[ 0 ],
- index: data.newTab.closest( "li" ).index()
+ tab: tab.find( ".ui-tabs-anchor" )[ 0],
+ panel: panel[ 0 ],
+ index: tab.closest( "li" ).index()
});
} else if ( type === "activate" && data.newTab.length ) {
ret = this._super( "show", event, {