aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-03-03 13:48:01 +0100
committerFelix Nagel <info@felixnagel.com>2013-03-03 13:48:01 +0100
commitdffe8f66109714af2d4ed8f582af4cf3439433e3 (patch)
treed83889fc566946bd35e4f8dc866f2aac5e4b095a /ui
parentd94e217065745e9ad0638cf68d3d973ffe44035a (diff)
parent6d3a1e1fe8cc21f385456ea26075f3909136a589 (diff)
downloadjquery-ui-dffe8f66109714af2d4ed8f582af4cf3439433e3.tar.gz
jquery-ui-dffe8f66109714af2d4ed8f582af4cf3439433e3.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui')
-rw-r--r--ui/i18n/jquery.ui.datepicker-de.js6
-rw-r--r--ui/i18n/jquery.ui.datepicker-sk.js6
-rw-r--r--ui/jquery.ui.autocomplete.js4
-rw-r--r--ui/jquery.ui.dialog.js19
-rw-r--r--ui/jquery.ui.draggable.js13
-rw-r--r--ui/jquery.ui.droppable.js3
-rw-r--r--ui/jquery.ui.effect.js94
-rw-r--r--ui/jquery.ui.position.js10
-rw-r--r--ui/jquery.ui.sortable.js40
-rw-r--r--ui/jquery.ui.spinner.js1
10 files changed, 118 insertions, 78 deletions
diff --git a/ui/i18n/jquery.ui.datepicker-de.js b/ui/i18n/jquery.ui.datepicker-de.js
index cfe91759b..abe75c4e4 100644
--- a/ui/i18n/jquery.ui.datepicker-de.js
+++ b/ui/i18n/jquery.ui.datepicker-de.js
@@ -2,10 +2,10 @@
/* Written by Milian Wolff (mail@milianw.de). */
jQuery(function($){
$.datepicker.regional['de'] = {
- closeText: 'schließen',
- prevText: '&#x3C;zurück',
+ closeText: 'Schließen',
+ prevText: '&#x3C;Zurück',
nextText: 'Vor&#x3E;',
- currentText: 'heute',
+ currentText: 'Heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
diff --git a/ui/i18n/jquery.ui.datepicker-sk.js b/ui/i18n/jquery.ui.datepicker-sk.js
index 83ae8e811..0cb76c4e8 100644
--- a/ui/i18n/jquery.ui.datepicker-sk.js
+++ b/ui/i18n/jquery.ui.datepicker-sk.js
@@ -6,11 +6,11 @@ jQuery(function($){
prevText: '&#x3C;Predchádzajúci',
nextText: 'Nasledujúci&#x3E;',
currentText: 'Dnes',
- monthNames: ['Január','Február','Marec','Apríl','Máj','Jún',
- 'Júl','August','September','Október','November','December'],
+ monthNames: ['január','február','marec','apríl','máj','jún',
+ 'júl','august','september','október','november','december'],
monthNamesShort: ['Jan','Feb','Mar','Apr','Máj','Jún',
'Júl','Aug','Sep','Okt','Nov','Dec'],
- dayNames: ['Nedeľa','Pondelok','Utorok','Streda','Štvrtok','Piatok','Sobota'],
+ dayNames: ['nedeľa','pondelok','utorok','streda','štvrtok','piatok','sobota'],
dayNamesShort: ['Ned','Pon','Uto','Str','Štv','Pia','Sob'],
dayNamesMin: ['Ne','Po','Ut','St','Št','Pia','So'],
weekHeader: 'Ty',
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index 1b0f2138f..b3a05da0b 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -234,7 +234,8 @@ $.widget( "ui.autocomplete", {
}
},
menufocus: function( event, ui ) {
- // #7024 - Prevent accidental activation of menu items in Firefox
+ // support: Firefox
+ // Prevent accidental activation of menu items in Firefox (#7024 #9118)
if ( this.isNewMenu ) {
this.isNewMenu = false;
if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
@@ -490,6 +491,7 @@ $.widget( "ui.autocomplete", {
_suggest: function( items ) {
var ul = this.menu.element.empty();
this._renderMenu( ul, items );
+ this.isNewMenu = true;
this.menu.refresh();
// size and position menu
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index 85dbddda2..b35c0ffcf 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -692,11 +692,23 @@ $.widget( "ui.dialog", {
}
},
+ _allowInteraction: function( event ) {
+ if ( $( event.target ).closest(".ui-dialog").length ) {
+ return true;
+ }
+
+ // TODO: Remove hack when datepicker implements
+ // the .ui-front logic (#8989)
+ return !!$( event.target ).closest(".ui-datepicker").length;
+ },
+
_createOverlay: function() {
if ( !this.options.modal ) {
return;
}
+ var that = this,
+ widgetFullName = this.widgetFullName;
if ( !$.ui.dialog.overlayInstances ) {
// Prevent use of anchors and inputs.
// We use a delay in case the overlay is created from an
@@ -705,13 +717,10 @@ $.widget( "ui.dialog", {
// Handle .dialog().dialog("close") (#4065)
if ( $.ui.dialog.overlayInstances ) {
this.document.bind( "focusin.dialog", function( event ) {
- if ( !$( event.target ).closest(".ui-dialog").length &&
- // TODO: Remove hack when datepicker implements
- // the .ui-front logic (#8989)
- !$( event.target ).closest(".ui-datepicker").length ) {
+ if ( !that._allowInteraction( event ) ) {
event.preventDefault();
$(".ui-dialog:visible:last .ui-dialog-content")
- .data("ui-dialog")._focusTabbable();
+ .data( widgetFullName )._focusTabbable();
}
});
}
diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js
index 9a31add7c..27b6b4ef0 100644
--- a/ui/jquery.ui.draggable.js
+++ b/ui/jquery.ui.draggable.js
@@ -600,7 +600,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
if(this.shouldRevert) {
- this.instance.options.revert = true;
+ this.instance.options.revert = this.shouldRevert;
}
//Trigger the stop of the sortable
@@ -908,22 +908,19 @@ $.ui.plugin.add("draggable", "snap", {
$.ui.plugin.add("draggable", "stack", {
start: function() {
-
var min,
- o = $(this).data("ui-draggable").options,
+ o = this.data("ui-draggable").options,
group = $.makeArray($(o.stack)).sort(function(a,b) {
return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
});
if (!group.length) { return; }
- min = parseInt(group[0].style.zIndex, 10) || 0;
+ min = parseInt($(group[0]).css("zIndex"), 10) || 0;
$(group).each(function(i) {
- this.style.zIndex = min + i;
+ $(this).css("zIndex", min + i);
});
-
- this[0].style.zIndex = min + group.length;
-
+ this.css("zIndex", (min + group.length));
}
});
diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js
index 4fbfcde06..552b24a58 100644
--- a/ui/jquery.ui.droppable.js
+++ b/ui/jquery.ui.droppable.js
@@ -278,7 +278,8 @@ $.ui.ddmanager = {
drop: function(draggable, event) {
var dropped = false;
- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
+ // Create a copy of the droppables in case the list changes during the drop (#9116)
+ $.each(($.ui.ddmanager.droppables[draggable.options.scope] || []).slice(), function() {
if(!this.options) {
return;
diff --git a/ui/jquery.ui.effect.js b/ui/jquery.ui.effect.js
index 97f006ee0..f3d9929b0 100644
--- a/ui/jquery.ui.effect.js
+++ b/ui/jquery.ui.effect.js
@@ -1106,14 +1106,29 @@ function _normalizeArguments( effect, options, speed, callback ) {
return effect;
}
-function standardSpeed( speed ) {
- // valid standard speeds
- if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
+function standardAnimationOption( option ) {
+ // Valid standard speeds (nothing, number, named speed)
+ if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
return true;
}
- // invalid strings - treat as "normal" speed
- return typeof speed === "string" && !$.effects.effect[ speed ];
+ // Invalid strings - treat as "normal" speed
+ if ( typeof option === "string" && !$.effects.effect[ option ] ) {
+ return true;
+ }
+
+ // Complete callback
+ if ( $.isFunction( option ) ) {
+ return true;
+ }
+
+ // Options hash (but not naming an effect)
+ if ( typeof option === "object" && !option.effect ) {
+ return true;
+ }
+
+ // Didn't match any standard API
+ return false;
}
$.fn.extend({
@@ -1150,9 +1165,10 @@ $.fn.extend({
}
}
- // if the element is hiddden and mode is hide,
- // or element is visible and mode is show
+ // If the element already has the correct final state, delegate to
+ // the core methods so the internal tracking of "olddisplay" works.
if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
+ elem[ mode ]();
done();
} else {
effectMethod.call( elem[0], args, done );
@@ -1162,39 +1178,41 @@ $.fn.extend({
return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
},
- _show: $.fn.show,
- show: function( speed ) {
- if ( standardSpeed( speed ) ) {
- return this._show.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "show";
- return this.effect.call( this, args );
- }
- },
+ show: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "show";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.show ),
- _hide: $.fn.hide,
- hide: function( speed ) {
- if ( standardSpeed( speed ) ) {
- return this._hide.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "hide";
- return this.effect.call( this, args );
- }
- },
+ hide: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "hide";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.hide ),
- // jQuery core overloads toggle and creates _toggle
- __toggle: $.fn.toggle,
- toggle: function( speed ) {
- if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
- return this.__toggle.apply( this, arguments );
- } else {
- var args = _normalizeArguments.apply( this, arguments );
- args.mode = "toggle";
- return this.effect.call( this, args );
- }
- },
+ toggle: (function( orig ) {
+ return function( option ) {
+ if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
+ return orig.apply( this, arguments );
+ } else {
+ var args = _normalizeArguments.apply( this, arguments );
+ args.mode = "toggle";
+ return this.effect.call( this, args );
+ }
+ };
+ })( $.fn.toggle ),
// helper functions
cssUnit: function(key) {
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index 0209b442c..2d3451c06 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -18,15 +18,15 @@ var cachedScrollbarWidth,
round = Math.round,
rhorizontal = /left|center|right/,
rvertical = /top|center|bottom/,
- roffset = /[\+\-]\d+%?/,
+ roffset = /[\+\-]\d+(\.[\d]+)?%?/,
rposition = /^\w+/,
rpercent = /%$/,
_position = $.fn.position;
function getOffsets( offsets, width, height ) {
return [
- parseInt( offsets[ 0 ], 10 ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
- parseInt( offsets[ 1 ], 10 ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
+ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ),
+ parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 )
];
}
@@ -95,8 +95,8 @@ $.position = {
hasOverflowY = overflowY === "scroll" ||
( overflowY === "auto" && within.height < within.element[0].scrollHeight );
return {
- width: hasOverflowX ? $.position.scrollbarWidth() : 0,
- height: hasOverflowY ? $.position.scrollbarWidth() : 0
+ width: hasOverflowY ? $.position.scrollbarWidth() : 0,
+ height: hasOverflowX ? $.position.scrollbarWidth() : 0
};
},
getWithinInfo: function( element ) {
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 211ff272e..f095ce9c5 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -158,7 +158,7 @@ $.widget("ui.sortable", $.ui.mouse, {
_mouseStart: function(event, overrideHandle, noActivation) {
- var i,
+ var i, body,
o = this.options;
this.currentContainer = this;
@@ -228,11 +228,14 @@ $.widget("ui.sortable", $.ui.mouse, {
this._setContainment();
}
- if(o.cursor) { // cursor option
- if ($("body").css("cursor")) {
- this._storedCursor = $("body").css("cursor");
- }
- $("body").css("cursor", o.cursor);
+ if( o.cursor && o.cursor !== "auto" ) { // cursor option
+ body = this.document.find( "body" );
+
+ // support: IE
+ this.storedCursor = body.css( "cursor" );
+ body.css( "cursor", o.cursor );
+
+ this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
}
if(o.opacity) { // opacity option
@@ -749,15 +752,23 @@ $.widget("ui.sortable", $.ui.mouse, {
o.placeholder = {
element: function() {
- var el = $(document.createElement(that.currentItem[0].nodeName))
- .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
- .removeClass("ui-sortable-helper")[0];
+ var nodeName = that.currentItem[0].nodeName.toLowerCase(),
+ element = $( that.document[0].createElement( nodeName ) )
+ .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
+ .removeClass("ui-sortable-helper");
+
+ if ( nodeName === "tr" ) {
+ // Use a high colspan to force the td to expand the full
+ // width of the table (browsers are smart enough to
+ // handle this properly)
+ element.append( "<td colspan='99'>&#160;</td>" );
+ }
- if(!className) {
- el.style.visibility = "hidden";
+ if ( !className ) {
+ element.css( "visibility", "hidden" );
}
- return el;
+ return element;
},
update: function(container, p) {
@@ -1178,8 +1189,9 @@ $.widget("ui.sortable", $.ui.mouse, {
}
//Do what was originally in plugins
- if(this._storedCursor) {
- $("body").css("cursor", this._storedCursor);
+ if ( this.storedCursor ) {
+ this.document.find( "body" ).css( "cursor", this.storedCursor );
+ this.storedStylesheet.remove();
}
if(this._storedOpacity) {
this.helper.css("opacity", this._storedOpacity);
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index c14ef9370..644b65239 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -102,6 +102,7 @@ $.widget( "ui.spinner", {
return;
}
+ this._stop();
this._refresh();
if ( this.previous !== this.element.val() ) {
this._trigger( "change", event );