" )
+ .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
+ uiButtonSet = $( "
" )
+ .addClass( "ui-dialog-buttonset" )
+ .appendTo( uiDialogButtonPane );
$.each( buttons, function( name, props ) {
props = $.isFunction( props ) ?
@@ -547,7 +549,8 @@ $.widget("ui.dialog", {
},
_setOption: function( key, value ) {
- var self = this,
+ var isDraggable, isResizable,
+ self = this,
uiDialog = self.uiDialog;
switch ( key ) {
@@ -571,7 +574,7 @@ $.widget("ui.dialog", {
}
break;
case "draggable":
- var isDraggable = uiDialog.is( ":data(draggable)" );
+ isDraggable = uiDialog.is( ":data(draggable)" );
if ( isDraggable && !value ) {
uiDialog.draggable( "destroy" );
}
@@ -585,7 +588,7 @@ $.widget("ui.dialog", {
break;
case "resizable":
// currently resizable, becoming non-resizable
- var isResizable = uiDialog.is( ":data(resizable)" );
+ isResizable = uiDialog.is( ":data(resizable)" );
if ( isResizable && !value ) {
uiDialog.resizable( "destroy" );
}
@@ -614,9 +617,8 @@ $.widget("ui.dialog", {
/* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
* divs will both have width and height set, so we need to reset them
*/
- var options = this.options,
- nonContentHeight,
- minContentHeight,
+ var nonContentHeight, minContentHeight, autoHeight,
+ options = this.options,
isVisible = this.uiDialog.is( ":visible" );
// reset content sizing
@@ -648,7 +650,7 @@ $.widget("ui.dialog", {
});
} else {
this.uiDialog.show();
- var autoHeight = this.element.css( "height", "auto" ).height();
+ autoHeight = this.element.css( "height", "auto" ).height();
if ( !isVisible ) {
this.uiDialog.hide();
}
@@ -740,7 +742,9 @@ $.extend( $.ui.dialog.overlay, {
},
destroy: function( $el ) {
- var indexOf = $.inArray( $el, this.instances );
+ var indexOf = $.inArray( $el, this.instances ),
+ maxZ = 0;
+
if ( indexOf !== -1 ) {
this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] );
}
@@ -752,7 +756,6 @@ $.extend( $.ui.dialog.overlay, {
$el.height( 0 ).width( 0 ).remove();
// adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
$.each( this.instances, function() {
maxZ = Math.max( maxZ, this.css( "z-index" ) );
});
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 0e4389305a..25b2567101 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Draggable @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index 19334bf4d4..47d3e38e9e 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Droppable @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 17177a9063..af22c19b02 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Menu @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -85,9 +85,9 @@ $.widget( "ui.menu", {
"mouseleave": "collapseAll",
"mouseleave .ui-menu": "collapseAll",
"focus": function( event ) {
- var firstItem = this.element.children( ".ui-menu-item" ).not( ".ui-state-disabled" ).eq( 0 );
+ var menu = this.element,
+ firstItem = menu.children( ".ui-menu-item" ).not( ".ui-state-disabled" ).eq( 0 );
if ( this._hasScroll() && !this.active ) {
- var menu = this.element;
menu.children().each( function() {
var currentItem = $( this );
if ( currentItem.offset().top - menu.offset().top >= 0 ) {
@@ -183,7 +183,7 @@ $.widget( "ui.menu", {
character = String.fromCharCode( event.keyCode ),
skip = false;
- if (character == prev) {
+ if (character === prev) {
skip = true;
} else {
character = prev + character;
@@ -195,7 +195,7 @@ $.widget( "ui.menu", {
return new RegExp("^" + escape(character), "i")
.test( $( this ).children( "a" ).text() );
});
- match = skip && match.index(this.active.next()) != -1 ? this.active.nextAll(".ui-menu-item") : match;
+ match = skip && match.index(this.active.next()) !== -1 ? this.active.nextAll(".ui-menu-item") : match;
if ( !match.length ) {
character = String.fromCharCode(event.keyCode);
match = this.activeMenu.children(".ui-menu-item").filter( function() {
@@ -260,15 +260,18 @@ $.widget( "ui.menu", {
refresh: function() {
// initialize nested menus
- var submenus = this.element.find( this.options.menus + ":not( .ui-menu )" )
- .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
- .attr( "role", "menu" )
- .hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ var menuId,
+ submenus = this.element.find( this.options.menus + ":not( .ui-menu )" )
+ .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
+ .hide()
+ .attr({
+ role: "menu",
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ });
// don't refresh list items that are already adapted
- var menuId = this.menuId;
+ menuId = this.menuId;
submenus.add( this.element ).children( ":not( .ui-menu-item ):has( a )" )
.addClass( "ui-menu-item" )
.attr( "role", "presentation" )
@@ -291,15 +294,16 @@ $.widget( "ui.menu", {
},
focus: function( event, item ) {
+ var nested, borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
this.blur( event );
if ( this._hasScroll() ) {
- var borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0,
- paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0,
- offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop,
- scroll = this.activeMenu.scrollTop(),
- elementHeight = this.activeMenu.height(),
- itemHeight = item.height();
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
+ scroll = this.activeMenu.scrollTop();
+ elementHeight = this.activeMenu.height();
+ itemHeight = item.height();
if ( offset < 0 ) {
this.activeMenu.scrollTop( scroll + offset );
@@ -321,7 +325,7 @@ $.widget( "ui.menu", {
this._close();
}, this.delay );
- var nested = $( "> .ui-menu", item );
+ nested = $( "> .ui-menu", item );
if ( nested.length && ( /^mouse/.test( event.type ) ) ) {
this._startOpening(nested);
}
@@ -368,9 +372,9 @@ $.widget( "ui.menu", {
var position = $.extend({}, {
of: this.active
- }, $.type(this.options.position) == "function"
- ? this.options.position(this.active)
- : this.options.position
+ }, $.type(this.options.position) === "function" ?
+ this.options.position(this.active) :
+ this.options.position
);
submenu.show()
diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js
index 64a081961e..eaa953ad00 100644
--- a/ui/jquery.ui.mouse.js
+++ b/ui/jquery.ui.mouse.js
@@ -46,11 +46,14 @@ $.widget("ui.mouse", {
// other instances of mouse
_mouseDestroy: function() {
this.element.unbind('.'+this.widgetName);
+ $(document)
+ .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
+ .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
},
_mouseDown: function(event) {
// don't let more than one widget handle mouseStart
- if( mouseHandled ) { return };
+ if( mouseHandled ) { return; }
// we may have missed mouseup (out of window)
(this._mouseStarted && this._mouseUp(event));
@@ -58,10 +61,10 @@ $.widget("ui.mouse", {
this._mouseDownEvent = event;
var that = this,
- btnIsLeft = (event.which == 1),
+ btnIsLeft = (event.which === 1),
// event.target.nodeName works around a bug in IE 8 with
// disabled inputs (#7620)
- elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
+ elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
return true;
}
@@ -131,7 +134,7 @@ $.widget("ui.mouse", {
if (this._mouseStarted) {
this._mouseStarted = false;
- if (event.target == this._mouseDownEvent.target) {
+ if (event.target === this._mouseDownEvent.target) {
$.data(event.target, this.widgetName + '.preventClickEvent', true);
}
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index 977e621a69..7fe31626d5 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Position @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -152,13 +152,13 @@ $.fn.position = function( options ) {
var elem = $( this ),
elemWidth = elem.outerWidth(),
elemHeight = elem.outerHeight(),
- marginLeft = parseInt( $.css( this, "marginLeft" ) ) || 0,
- marginTop = parseInt( $.css( this, "marginTop" ) ) || 0,
+ marginLeft = parseInt( $.css( this, "marginLeft" ), 10 ) || 0,
+ marginTop = parseInt( $.css( this, "marginTop" ), 10 ) || 0,
scrollInfo = $.position.getScrollInfo( within ),
collisionWidth = elemWidth + marginLeft +
- ( parseInt( $.css( this, "marginRight" ) ) || 0 ) + scrollInfo.width,
+ ( parseInt( $.css( this, "marginRight" ), 10 ) || 0 ) + scrollInfo.width,
collisionHeight = elemHeight + marginTop +
- ( parseInt( $.css( this, "marginBottom" ) ) || 0 ) + scrollInfo.height,
+ ( parseInt( $.css( this, "marginBottom" ), 10 ) || 0 ) + scrollInfo.height,
position = $.extend( {}, basePosition ),
myOffset = [
parseInt( offsets.my[ 0 ], 10 ) *
@@ -483,7 +483,7 @@ if ( $.uiBackCompat !== false ) {
at: at[ 0 ] + offset[ 0 ] + " " + at[ 1 ] + offset[ 1 ],
offset: undefined
} ) );
- }
+ };
}( jQuery ) );
}
diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js
index 26f5e76f0e..68cccc5540 100644
--- a/ui/jquery.ui.progressbar.js
+++ b/ui/jquery.ui.progressbar.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Progressbar @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -85,8 +85,8 @@ $.widget( "ui.progressbar", {
},
_refreshValue: function() {
- var value = this.value();
- var percentage = this._percentage();
+ var value = this.value(),
+ percentage = this._percentage();
if ( this.oldValue !== value ) {
this.oldValue = value;
diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js
index 77fe8bcc18..9be33927ee 100644
--- a/ui/jquery.ui.resizable.js
+++ b/ui/jquery.ui.resizable.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Resizable @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js
index ec54b5d9c4..3244e654e3 100644
--- a/ui/jquery.ui.selectable.js
+++ b/ui/jquery.ui.selectable.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Selectable @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index 75c6631cae..b355f8c7eb 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Slider @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -35,7 +35,8 @@ $.widget( "ui.slider", $.ui.mouse, {
},
_create: function() {
- var self = this,
+ var i,
+ self = this,
o = this.options,
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
handle = "
",
@@ -78,7 +79,7 @@ $.widget( "ui.slider", $.ui.mouse, {
( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
}
- for ( var i = existingHandles.length; i < handleCount; i += 1 ) {
+ for ( i = existingHandles.length; i < handleCount; i++ ) {
handles.push( handle );
}
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 4c6a471697..4093be245f 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Sortable @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index dab7ce4713..bd55a09ea2 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Spinner @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js
index ba48c37700..68c182c312 100644
--- a/ui/jquery.ui.tabs.js
+++ b/ui/jquery.ui.tabs.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Tabs @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -20,13 +20,13 @@ function getNextTabId() {
return ++tabId;
}
-var isLocal = function( anchor ) {
+function isLocal( anchor ) {
// clone the node to work around IE 6 not normalizing the href property
// if it's manually set, i.e., a.href = "#foo" kills the normalization
anchor = anchor.cloneNode( false );
return anchor.hash.length > 1 &&
anchor.href.replace( rhash, "" ) === location.href.replace( rhash, "" );
-};
+}
$.widget( "ui.tabs", {
version: "@VERSION",
@@ -44,7 +44,8 @@ $.widget( "ui.tabs", {
},
_create: function() {
- var that = this,
+ var panel,
+ that = this,
options = that.options,
active = options.active;
@@ -110,7 +111,7 @@ $.widget( "ui.tabs", {
// check for length avoids error when initializing empty list
if ( options.active !== false && this.anchors.length ) {
this.active = this._findActive( options.active );
- var panel = that._getPanelForTab( this.active );
+ panel = that._getPanelForTab( this.active );
panel.show();
this.lis.eq( options.active ).addClass( "ui-tabs-active ui-state-active" );
@@ -128,7 +129,7 @@ $.widget( "ui.tabs", {
},
_setOption: function( key, value ) {
- if ( key == "active" ) {
+ if ( key === "active" ) {
// _activate() will handle invalid values and update this.options
this._activate( value );
return;
@@ -166,7 +167,8 @@ $.widget( "ui.tabs", {
},
refresh: function() {
- var self = this,
+ var next,
+ self = this,
options = this.options,
lis = this.list.children( ":has(a[href])" );
@@ -187,7 +189,7 @@ $.widget( "ui.tabs", {
// was active, but active tab is gone
} else if ( this.active.length && !$.contains( this.list[ 0 ], this.active[ 0 ] ) ) {
// activate previous tab
- var next = options.active - 1;
+ next = options.active - 1;
this._activate( next >= 0 ? next : 0 );
// was active, active tab still exists
} else {
@@ -224,7 +226,7 @@ $.widget( "ui.tabs", {
this.panels = $( [] );
this.anchors.each(function( i, a ) {
- var selector, panel;
+ var selector, panel, id;
// inline tab
if ( isLocal( a ) ) {
@@ -232,7 +234,7 @@ $.widget( "ui.tabs", {
panel = self.element.find( self._sanitizeSelector( selector ) );
// remote tab
} else {
- var id = self._tabId( a );
+ id = self._tabId( a );
selector = "#" + id;
panel = self.element.find( selector );
if ( !panel.length ) {
@@ -433,8 +435,8 @@ $.widget( "ui.tabs", {
_getIndex: function( index ) {
// meta-function to give users option to provide a href string instead of a numerical index.
// also sanitizes numerical indexes to valid values.
- if ( typeof index == "string" ) {
- index = this.anchors.index( this.anchors.filter( "[href$=" + index + "]" ) );
+ if ( typeof index === "string" ) {
+ index = this.anchors.index( this.anchors.filter( "[href$='" + index + "']" ) );
}
return index;
@@ -747,7 +749,8 @@ if ( $.uiBackCompat !== false ) {
index = this.anchors.length;
}
- var options = this.options,
+ var doInsertAfter, panel,
+ options = this.options,
li = $( options.tabTemplate
.replace( /#\{href\}/g, url )
.replace( /#\{label\}/g, label ) ),
@@ -758,10 +761,10 @@ if ( $.uiBackCompat !== false ) {
li.addClass( "ui-state-default ui-corner-top" ).data( "ui-tabs-destroy", true );
li.find( "a" ).attr( "aria-controls", id );
- var doInsertAfter = index >= this.lis.length;
+ doInsertAfter = index >= this.lis.length;
// try to find an existing element before creating a new one
- var panel = this.element.find( "#" + id );
+ panel = this.element.find( "#" + id );
if ( !panel.length ) {
panel = this._createPanel( id );
if ( doInsertAfter ) {
@@ -946,6 +949,8 @@ if ( $.uiBackCompat !== false ) {
});
// cookie option
+ (function() {
+
var listId = 0;
$.widget( "ui.tabs", $.ui.tabs, {
@@ -966,7 +971,7 @@ if ( $.uiBackCompat !== false ) {
},
_cookie: function( active ) {
var cookie = [ this.cookie ||
- ( this.cookie = this.options.cookie.name || "ui-tabs-" + ++listId ) ];
+ ( this.cookie = this.options.cookie.name || "ui-tabs-" + (++listId) ) ];
if ( arguments.length ) {
cookie.push( active === false ? -1 : active );
cookie.push( this.options.cookie );
@@ -993,6 +998,8 @@ if ( $.uiBackCompat !== false ) {
}
});
+ })();
+
// load event
$.widget( "ui.tabs", $.ui.tabs, {
_trigger: function( type, event, data ) {
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index eddd9a0c96..97895a6a8b 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -1,4 +1,4 @@
-/*
+/*!
* jQuery UI Tooltip @VERSION
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
@@ -99,7 +99,7 @@ $.widget( "ui.tooltip", {
return;
}
- if ( !target.data( "ui-tooltip-title" ) ) {
+ if ( target.attr( "title" ) ) {
target.data( "ui-tooltip-title", target.attr( "title" ) );
}
@@ -159,7 +159,7 @@ $.widget( "ui.tooltip", {
mouseleave: "close",
focusout: "close",
keyup: function( event ) {
- if ( event.keyCode == $.ui.keyCode.ESCAPE ) {
+ if ( event.keyCode === $.ui.keyCode.ESCAPE ) {
var fakeEvent = $.Event(event);
fakeEvent.currentTarget = target[0];
this.close( fakeEvent, true );
@@ -173,6 +173,12 @@ $.widget( "ui.tooltip", {
target = $( event ? event.currentTarget : this.element ),
tooltip = this._find( target );
+ // disabling closes the tooltip, so we need to track when we're closing
+ // to avoid an infinite loop in case the tooltip becomes disabled on close
+ if ( this.closing ) {
+ return;
+ }
+
// don't close if the element has focus
// this prevents the tooltip from closing if you hover while focused
if ( !force && this.document[0].activeElement === target[0] ) {
@@ -195,7 +201,9 @@ $.widget( "ui.tooltip", {
target.removeData( "tooltip-open" );
target.unbind( "mouseleave.tooltip focusout.tooltip keyup.tooltip" );
+ this.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
+ this.closing = false;
},
_tooltip: function( element ) {
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 1b7405e28b..3e3723398d 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -9,9 +9,8 @@
*/
(function( $, undefined ) {
-var slice = Array.prototype.slice;
-
-var _cleanData = $.cleanData;
+var slice = Array.prototype.slice,
+ _cleanData = $.cleanData;
$.cleanData = function( elems ) {
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
try {
@@ -73,11 +72,11 @@ $.widget = function( name, base, prototype ) {
if ( $.isFunction( value ) ) {
prototype[ prop ] = (function() {
var _super = function() {
- return base.prototype[ prop ].apply( this, arguments );
- };
- var _superApply = function( args ) {
- return base.prototype[ prop ].apply( this, args );
- };
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
return function() {
var __super = this._super,
__superApply = this._superApply,
@@ -163,7 +162,8 @@ $.widget.bridge = function( name, object ) {
if ( isMethodCall ) {
this.each(function() {
- var instance = $.data( this, fullName );
+ var methodValue,
+ instance = $.data( this, fullName );
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
@@ -171,7 +171,7 @@ $.widget.bridge = function( name, object ) {
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
- var methodValue = instance[ options ].apply( instance, args );
+ methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
diff --git a/version.txt b/version.txt
index 13c1a73714..c70a1dfdce 100644
--- a/version.txt
+++ b/version.txt
@@ -1 +1 @@
-1.9pre
+1.9.0pre
\ No newline at end of file