aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.autocomplete.js20
-rw-r--r--ui/jquery.ui.core.js15
-rw-r--r--ui/jquery.ui.draggable.js2
-rw-r--r--ui/jquery.ui.droppable.js2
-rw-r--r--ui/jquery.ui.effect.js2
-rw-r--r--ui/jquery.ui.menu.js2
-rw-r--r--ui/jquery.ui.progressbar.js3
-rw-r--r--ui/jquery.ui.selectable.js2
-rw-r--r--ui/jquery.ui.slider.js2
-rw-r--r--ui/jquery.ui.sortable.js2
-rw-r--r--ui/jquery.ui.tooltip.js4
11 files changed, 38 insertions, 18 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index a858b3382..65f702a28 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -23,7 +23,7 @@ $.widget( "ui.autocomplete", {
version: "@VERSION",
defaultElement: "<input>",
options: {
- appendTo: "body",
+ appendTo: null,
autoFocus: false,
delay: 300,
minLength: 1,
@@ -323,10 +323,22 @@ $.widget( "ui.autocomplete", {
_appendTo: function() {
var element = this.options.appendTo;
- if ( element && (element.jquery || element.nodeType) ) {
- return $( element );
+
+ if ( element ) {
+ element = element.jquery || element.nodeType ?
+ $( element ) :
+ this.document.find( element ).eq( 0 );
+ }
+
+ if ( !element ) {
+ element = this.element.closest( ".ui-front" );
}
- return this.document.find( element || "body" ).eq( 0 );
+
+ if ( !element.length ) {
+ element = this.document[0].body;
+ }
+
+ return element;
},
_isMultiLine: function() {
diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js
index bd3e30758..694cb1bef 100644
--- a/ui/jquery.ui.core.js
+++ b/ui/jquery.ui.core.js
@@ -152,7 +152,7 @@ function focusable( element, isTabIndexNotNaN ) {
function visible( element ) {
return $.expr.filters.visible( element ) &&
- !$( element ).parents().andSelf().filter(function() {
+ !$( element ).parents().addBack().filter(function() {
return $.css( this, "visibility" ) === "hidden";
}).length;
}
@@ -180,9 +180,6 @@ $.extend( $.expr[ ":" ], {
}
});
-// support
-$.support.selectstart = "onselectstart" in document.createElement( "div" );
-
// support: jQuery <1.8
if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
$.each( [ "Width", "Height" ], function( i, name ) {
@@ -230,6 +227,15 @@ if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
});
}
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+ $.fn.addBack = function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ };
+}
+
// 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 ) {
@@ -250,6 +256,7 @@ if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
// deprecated
$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+$.support.selectstart = "onselectstart" in document.createElement( "div" );
$.fn.extend({
disableSelection: function() {
return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index b982ac6be..63a9b9114 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -280,7 +280,7 @@ $.widget("ui.draggable", $.ui.mouse, {
var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
$(this.options.handle, this.element)
.find("*")
- .andSelf()
+ .addBack()
.each(function() {
if(this === event.target) {
handle = true;
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index e2da0b9f6..a6959fd0f 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -235,7 +235,7 @@ $.ui.ddmanager = {
var i, j,
m = $.ui.ddmanager.droppables[t.options.scope] || [],
type = event ? event.type : null, // workaround for #2317
- list = (t.currentItem || t.element).find(":data(ui-droppable)").andSelf();
+ list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack();
droppablesLoop: for (i = 0; i < m.length; i++) {
diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js
index d8d32e932..83d78a9b4 100644
--- a/ui/jquery.ui.effect.js
+++ b/ui/jquery.ui.effect.js
@@ -761,7 +761,7 @@ $.effects.animateClass = function( value, duration, easing, callback ) {
var animated = $( this ),
baseClass = animated.attr( "class" ) || "",
applyClassChange,
- allAnimations = o.children ? animated.find( "*" ).andSelf() : animated;
+ allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
// map the animated objects to store the original styles.
allAnimations = allAnimations.map(function() {
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 41a69c472..7f37b6b06 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -139,7 +139,7 @@ $.widget( "ui.menu", {
// Destroy (sub)menus
this.element
.removeAttr( "aria-activedescendant" )
- .find( ".ui-menu" ).andSelf()
+ .find( ".ui-menu" ).addBack()
.removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons" )
.removeAttr( "role" )
.removeAttr( "tabIndex" )
diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js
index 163bb06cd..e8b9b911a 100644
--- a/ui/jquery.ui.progressbar.js
+++ b/ui/jquery.ui.progressbar.js
@@ -112,9 +112,10 @@ $.widget( "ui.progressbar", {
this.valueDiv
.toggle( this.indeterminate || value > this.min )
.toggleClass( "ui-corner-right", value === this.options.max )
- .toggleClass( "ui-progressbar-indeterminate", this.indeterminate )
.width( percentage.toFixed(0) + "%" );
+ this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
+
if ( this.indeterminate ) {
this.element.removeAttr( "aria-valuenow" );
if ( !this.overlayDiv ) {
diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js
index a9b15b20b..164862d14 100644
--- a/ui/jquery.ui.selectable.js
+++ b/ui/jquery.ui.selectable.js
@@ -113,7 +113,7 @@ $.widget("ui.selectable", $.ui.mouse, {
}
});
- $(event.target).parents().andSelf().each(function() {
+ $(event.target).parents().addBack().each(function() {
var doSelect,
selectee = $.data(this, "selectable-item");
if (selectee) {
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index 02fee8364..4054f1848 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -256,7 +256,7 @@ $.widget( "ui.slider", $.ui.mouse, {
.focus();
offset = closestHandle.offset();
- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
top: event.pageY - offset.top -
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index e142a0ede..08de5b22a 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -126,7 +126,7 @@ $.widget("ui.sortable", $.ui.mouse, {
return false;
}
if(this.options.handle && !overrideHandle) {
- $(this.options.handle, currentItem).find("*").andSelf().each(function() {
+ $(this.options.handle, currentItem).find("*").addBack().each(function() {
if(this === event.target) {
validHandle = true;
}
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index ab8d5173c..3984826ce 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -113,7 +113,7 @@ $.widget( "ui.tooltip", {
});
// remove title attributes to prevent native tooltips
- this.element.find( this.options.items ).andSelf().each(function() {
+ this.element.find( this.options.items ).addBack().each(function() {
var element = $( this );
if ( element.is( "[title]" ) ) {
element
@@ -125,7 +125,7 @@ $.widget( "ui.tooltip", {
_enable: function() {
// restore title attributes
- this.element.find( this.options.items ).andSelf().each(function() {
+ this.element.find( this.options.items ).addBack().each(function() {
var element = $( this );
if ( element.data( "ui-tooltip-title" ) ) {
element.attr( "title", element.data( "ui-tooltip-title" ) );