aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/i18n/jquery.ui.datepicker-nl.js2
-rw-r--r--ui/jquery.ui.accordion.js35
-rw-r--r--ui/jquery.ui.autocomplete.js2
-rw-r--r--ui/jquery.ui.button.js20
-rw-r--r--ui/jquery.ui.datepicker.js8
-rw-r--r--ui/jquery.ui.dialog.js4
-rw-r--r--ui/jquery.ui.menu.js76
-rw-r--r--ui/jquery.ui.menubar.js30
-rw-r--r--ui/jquery.ui.popup.js10
-rw-r--r--ui/jquery.ui.slider.js4
-rw-r--r--ui/jquery.ui.spinner.js6
11 files changed, 115 insertions, 82 deletions
diff --git a/ui/i18n/jquery.ui.datepicker-nl.js b/ui/i18n/jquery.ui.datepicker-nl.js
index 09634088b..781fe6191 100644
--- a/ui/i18n/jquery.ui.datepicker-nl.js
+++ b/ui/i18n/jquery.ui.datepicker-nl.js
@@ -8,7 +8,7 @@ jQuery(function($){
currentText: 'Vandaag',
monthNames: ['januari', 'februari', 'maart', 'april', 'mei', 'juni',
'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
- monthNamesShort: ['jan', 'feb', 'maa', 'apr', 'mei', 'jun',
+ monthNamesShort: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun',
'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
dayNames: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
dayNamesShort: ['zon', 'maa', 'din', 'woe', 'don', 'vri', 'zat'],
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js
index acd19c981..c976e3e69 100644
--- a/ui/jquery.ui.accordion.js
+++ b/ui/jquery.ui.accordion.js
@@ -12,6 +12,8 @@
* jquery.ui.widget.js
*/
(function( $, undefined ) {
+
+var lastToggle = {};
// TODO: use ui-accordion-header-active class and fix styling
$.widget( "ui.accordion", {
@@ -37,8 +39,6 @@ $.widget( "ui.accordion", {
var self = this,
options = self.options;
- self.running = false;
-
self.element.addClass( "ui-accordion ui-widget ui-helper-reset" );
self.headers = self.element.find( options.header )
@@ -90,12 +90,11 @@ $.widget( "ui.accordion", {
if ( !self.active.length ) {
self.headers.eq( 0 ).attr( "tabIndex", 0 );
} else {
- self.active
- .attr({
- "aria-expanded": "true",
- "aria-selected": "true",
- tabIndex: 0
- });
+ self.active.attr({
+ "aria-expanded": "true",
+ "aria-selected": "true",
+ tabIndex: 0
+ });
}
// only need links in tab order for Safari
@@ -321,8 +320,6 @@ $.widget( "ui.accordion", {
event.preventDefault();
if ( options.disabled ||
- // can't switch during an animation
- this.running ||
// click on active header, but not collapsible
( clickedIsActive && !options.collapsible ) ||
// allow canceling activation
@@ -363,7 +360,6 @@ $.widget( "ui.accordion", {
toShow = data.newContent,
toHide = data.oldContent;
- self.running = true;
function complete() {
self._completed( data );
}
@@ -384,6 +380,8 @@ $.widget( "ui.accordion", {
animations[ animation ]({
toShow: toShow,
toHide: toHide,
+ prevShow: lastToggle.toShow,
+ prevHide: lastToggle.toHide,
complete: complete,
down: toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) )
}, additional );
@@ -414,8 +412,6 @@ $.widget( "ui.accordion", {
var toShow = data.newContent,
toHide = data.oldContent;
- this.running = false;
-
if ( this.options.heightStyle === "content" ) {
toShow.add( toHide ).css({
height: "",
@@ -437,6 +433,11 @@ $.widget( "ui.accordion", {
$.extend( $.ui.accordion, {
animations: {
slide: function( options, additions ) {
+ if ( options.prevShow || options.prevHide ) {
+ options.prevHide.stop( true, true );
+ options.toHide = options.prevShow;
+ }
+
var showOverflow = options.toShow.css( "overflow" ),
hideOverflow = options.toHide.css( "overflow" ),
percentDone = 0,
@@ -448,6 +449,9 @@ $.extend( $.ui.accordion, {
easing: "swing",
duration: 300
}, options, additions );
+
+ lastToggle = options;
+
if ( !options.toHide.size() ) {
originalWidth = options.toShow[0].style.width;
options.toShow
@@ -504,10 +508,7 @@ $.extend( $.ui.accordion, {
.filter( ":visible" )
.animate( hideProps, {
step: function( now, settings ) {
- // only calculate the percent when animating height
- // IE gets very inconsistent results when animating elements
- // with small values, which is common for padding
- if ( settings.prop == "height" ) {
+ if ( settings.prop == "height" || settings.prop == "paddingTop" || settings.prop == "paddingBottom" ) {
percentDone = ( settings.end - settings.start === 0 ) ? 0 :
( settings.now - settings.start ) / ( settings.end - settings.start );
}
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index e39b4649e..59caf625d 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -63,7 +63,7 @@ $.widget( "ui.autocomplete", {
"aria-haspopup": "true"
})
.bind( "keydown.autocomplete", function( event ) {
- if ( self.options.disabled || self.element.attr( "readonly" ) ) {
+ if ( self.options.disabled || self.element.prop( "readonly" ) ) {
suppressKeyPress = true;
suppressInput = true;
return;
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js
index 482cdc24c..ad17ab0c1 100644
--- a/ui/jquery.ui.button.js
+++ b/ui/jquery.ui.button.js
@@ -58,7 +58,7 @@ $.widget( "ui.button", {
.bind( "reset.button", formResetHandler );
if ( typeof this.options.disabled !== "boolean" ) {
- this.options.disabled = this.element.attr( "disabled" );
+ this.options.disabled = this.element.prop( "disabled" );
}
this._determineButtonType();
@@ -155,7 +155,7 @@ $.widget( "ui.button", {
return false;
}
$( this ).addClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", true );
+ self.buttonElement.attr( "aria-pressed", "true" );
var radio = self.element[ 0 ];
radioGroup( radio )
@@ -164,7 +164,7 @@ $.widget( "ui.button", {
return $( this ).button( "widget" )[ 0 ];
})
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
});
} else {
this.buttonElement
@@ -244,7 +244,7 @@ $.widget( "ui.button", {
if ( checked ) {
this.buttonElement.addClass( "ui-state-active" );
}
- this.buttonElement.attr( "aria-pressed", checked );
+ this.buttonElement.prop( "aria-pressed", checked );
} else {
this.buttonElement = this.element;
}
@@ -272,9 +272,9 @@ $.widget( "ui.button", {
this._super( "_setOption", key, value );
if ( key === "disabled" ) {
if ( value ) {
- this.element.attr( "disabled", true );
+ this.element.prop( "disabled", true );
} else {
- this.element.removeAttr( "disabled" );
+ this.element.prop( "disabled", false );
}
return;
}
@@ -291,22 +291,22 @@ $.widget( "ui.button", {
if ( $( this ).is( ":checked" ) ) {
$( this ).button( "widget" )
.addClass( "ui-state-active" )
- .attr( "aria-pressed", true );
+ .attr( "aria-pressed", "true" );
} else {
$( this ).button( "widget" )
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
}
});
} else if ( this.type === "checkbox" ) {
if ( this.element.is( ":checked" ) ) {
this.buttonElement
.addClass( "ui-state-active" )
- .attr( "aria-pressed", true );
+ .attr( "aria-pressed", "true" );
} else {
this.buttonElement
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .attr( "aria-pressed", "false" );
}
}
},
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index aeadde4ee..9f7f0b6e1 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -285,7 +285,9 @@ $.extend(Datepicker.prototype, {
if( inst.settings.disabled ) {
this._disableDatepicker( target );
}
- inst.dpDiv.show();
+ // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
+ // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
+ inst.dpDiv.css( "display", "block" );
},
/* Pop-up the date picker in a "dialog" box.
@@ -377,7 +379,7 @@ $.extend(Datepicker.prototype, {
var inline = $target.children('.' + this._inlineClass);
inline.children().removeClass('ui-state-disabled');
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- removeAttr("disabled");
+ prop("disabled", false);
}
this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry
@@ -402,7 +404,7 @@ $.extend(Datepicker.prototype, {
var inline = $target.children('.' + this._inlineClass);
inline.children().addClass('ui-state-disabled');
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- attr("disabled", "disabled");
+ prop("disabled", true);
}
this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js
index e9cf67540..493ed07e6 100644
--- a/ui/jquery.ui.dialog.js
+++ b/ui/jquery.ui.dialog.js
@@ -265,8 +265,8 @@ $.widget("ui.dialog", {
// Opera 9.5+ resets when parent z-index is changed.
// http://bugs.jqueryui.com/ticket/3193
saveScroll = {
- scrollTop: self.element.attr( "scrollTop" ),
- scrollLeft: self.element.attr( "scrollLeft" )
+ scrollTop: self.element.scrollTop(),
+ scrollLeft: self.element.scrollLeft()
};
$.ui.dialog.maxZ += 1;
self.uiDialog.css( "z-index", $.ui.dialog.maxZ );
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index f6012de4f..ad7a9c8c1 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -89,6 +89,16 @@ $.widget( "ui.menu", {
event.preventDefault();
event.stopImmediatePropagation();
break;
+ case $.ui.keyCode.HOME:
+ self._move( "first", "first", event );
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ break;
+ case $.ui.keyCode.END:
+ self._move( "last", "last", event );
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ break;
case $.ui.keyCode.UP:
self.previous( event );
event.preventDefault();
@@ -176,7 +186,7 @@ $.widget( "ui.menu", {
this._bind( document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
- this.collapseAll();
+ this.collapseAll( event );
}
}
});
@@ -249,20 +259,20 @@ $.widget( "ui.menu", {
var nested,
self = this;
- this.blur();
+ this.blur( event );
if ( this._hasScroll() ) {
- var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true ) ) || 0,
- paddingTop = parseFloat( $.curCSS( this.element[0], "paddingTop", true ) ) || 0,
- offset = item.offset().top - this.element.offset().top - borderTop - paddingTop,
- scroll = this.element.scrollTop(),
- elementHeight = this.element.height(),
+ var borderTop = parseFloat( $.curCSS( this.activeMenu[0], "borderTopWidth", true ) ) || 0,
+ paddingTop = parseFloat( $.curCSS( this.activeMenu[0], "paddingTop", true ) ) || 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.element.scrollTop( scroll + offset );
+ this.activeMenu.scrollTop( scroll + offset );
} else if ( offset + itemHeight > elementHeight ) {
- this.element.scrollTop( scroll + offset - elementHeight + itemHeight );
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
}
}
@@ -297,6 +307,8 @@ $.widget( "ui.menu", {
this.active.children( "a" ).removeClass( "ui-state-focus" );
this.active = null;
+
+ this._trigger( "blur", event, { item: this.active } );
},
_startOpening: function( submenu ) {
@@ -336,7 +348,7 @@ $.widget( "ui.menu", {
.position( position );
},
- collapseAll: function() {
+ collapseAll: function( event ) {
this.element
.find( "ul" )
.hide()
@@ -346,7 +358,7 @@ $.widget( "ui.menu", {
.find( "a.ui-state-active" )
.removeClass( "ui-state-active" );
- this.blur();
+ this.blur( event );
this.activeMenu = this.element;
},
@@ -389,11 +401,11 @@ $.widget( "ui.menu", {
},
next: function(event) {
- this._move( "next", ".ui-menu-item", "first", event );
+ this._move( "next", "first", event );
},
previous: function(event) {
- this._move( "prev", ".ui-menu-item", "last", event );
+ this._move( "prev", "last", event );
},
first: function() {
@@ -404,25 +416,36 @@ $.widget( "ui.menu", {
return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
},
- _move: function( direction, edge, filter, event ) {
+ _move: function( direction, filter, event ) {
if ( !this.active ) {
- this.focus( event, this.activeMenu.children( edge )[ filter ]() );
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" )[ filter ]() );
return;
}
- var next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 );
+
+ var next;
+ if ( direction === "first" || direction === "last" ) {
+ next = this.active[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ).eq( -1 );
+ } else {
+ next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 );
+ }
+
if ( next.length ) {
this.focus( event, next );
} else {
- this.focus( event, this.activeMenu.children( edge )[ filter ]() );
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" )[ filter ]() );
}
},
nextPage: function( event ) {
if ( this._hasScroll() ) {
- if ( !this.active || this.last() ) {
+ if ( !this.active ) {
this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
return;
}
+ if ( this.last() ) {
+ return;
+ }
+
var base = this.active.offset().top,
height = this.element.height(),
result;
@@ -434,14 +457,17 @@ $.widget( "ui.menu", {
this.focus( event, result );
} else {
this.focus( event, this.activeMenu.children( ".ui-menu-item" )
- [ !this.active || this.last() ? "first" : "last" ]() );
+ [ !this.active ? "first" : "last" ]() );
}
},
previousPage: function( event ) {
if ( this._hasScroll() ) {
- if ( !this.active || this.first() ) {
- this.focus( event, this.activeMenu.children( ".ui-menu-item" ).last() );
+ if ( !this.active ) {
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
+ return;
+ }
+ if ( this.first() ) {
return;
}
@@ -455,14 +481,12 @@ $.widget( "ui.menu", {
this.focus( event, result );
} else {
- this.focus( event, this.activeMenu.children( ".ui-menu-item" )
- [ !this.active || this.first() ? ":last" : ":first" ]() );
+ this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
}
},
_hasScroll: function() {
- // TODO: just use .prop() when we drop support for jQuery <1.6
- return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]( "scrollHeight" );
+ return this.element.height() < this.element.prop( "scrollHeight" );
},
select: function( event ) {
@@ -470,7 +494,7 @@ $.widget( "ui.menu", {
var ui = {
item: this.active
};
- this.collapseAll();
+ this.collapseAll( event );
this._trigger( "select", event, ui );
}
});
diff --git a/ui/jquery.ui.menubar.js b/ui/jquery.ui.menubar.js
index fd6d92d6b..9af3aa080 100644
--- a/ui/jquery.ui.menubar.js
+++ b/ui/jquery.ui.menubar.js
@@ -56,8 +56,10 @@ $.widget( "ui.menubar", {
}
})
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" )
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ })
.bind( "keydown.menubar", function( event ) {
var menu = $( this );
if ( menu.is( ":hidden" ) )
@@ -172,19 +174,19 @@ $.widget( "ui.menubar", {
_destroy : function() {
var items = this.element.children( "li" )
.removeClass( "ui-menubar-item" )
- .removeAttr( "role", "presentation" )
+ .removeAttr( "role" )
.children( "button, a" );
this.element
.removeClass( "ui-menubar ui-widget-header ui-helper-clearfix" )
- .removeAttr( "role", "menubar" )
+ .removeAttr( "role" )
.unbind( ".menubar" );
items
.unbind( ".menubar" )
.removeClass( "ui-button ui-widget ui-button-text-only ui-menubar-link ui-state-default" )
- .removeAttr( "role", "menuitem" )
- .removeAttr( "aria-haspopup", "true" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-haspopup" )
// TODO unwrap?
.children( "span.ui-button-text" ).each(function( i, e ) {
var item = $( this );
@@ -196,8 +198,8 @@ $.widget( "ui.menubar", {
this.element.find( ":ui-menu" )
.menu( "destroy" )
.show()
- .removeAttr( "aria-hidden", "true" )
- .removeAttr( "aria-expanded", "false" )
+ .removeAttr( "aria-hidden" )
+ .removeAttr( "aria-expanded" )
.removeAttr( "tabindex" )
.unbind( ".menubar" );
},
@@ -208,8 +210,10 @@ $.widget( "ui.menubar", {
this.active
.menu( "collapseAll" )
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ });
this.active
.prev()
.removeClass( "ui-state-active" )
@@ -228,8 +232,10 @@ $.widget( "ui.menubar", {
this.active
.menu( "collapseAll" )
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ .attr({
+ "aria-hidden": "true",
+ "aria-expanded": "false"
+ });
this.active
.prev()
.removeClass( "ui-state-active" );
diff --git a/ui/jquery.ui.popup.js b/ui/jquery.ui.popup.js
index d455346dc..508209a55 100644
--- a/ui/jquery.ui.popup.js
+++ b/ui/jquery.ui.popup.js
@@ -41,7 +41,7 @@ $.widget( "ui.popup", {
}
this.options.trigger
- .attr( "aria-haspopup", true )
+ .attr( "aria-haspopup", "true" )
.attr( "aria-owns", this.element.attr( "id" ) );
this.element
@@ -163,8 +163,8 @@ $.widget( "ui.popup", {
this.element
.show()
- .attr( "aria-hidden", false )
- .attr( "aria-expanded", true )
+ .attr( "aria-hidden", "false" )
+ .attr( "aria-expanded", "true" )
.position( position );
if (this.element.is( ":ui-menu" )) { //popup is a menu
@@ -194,8 +194,8 @@ $.widget( "ui.popup", {
close: function( event ) {
this.element
.hide()
- .attr( "aria-hidden", true )
- .attr( "aria-expanded", false );
+ .attr( "aria-hidden", "true" )
+ .attr( "aria-expanded", "false" );
this.options.trigger.attr( "tabindex" , 0 );
if ( this.removeTabIndex ) {
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index 978155370..9c5d21ffb 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -502,10 +502,10 @@ $.widget( "ui.slider", $.ui.mouse, {
if ( value ) {
this.handles.filter( ".ui-state-focus" ).blur();
this.handles.removeClass( "ui-state-hover" );
- this.handles.attr( "disabled", "disabled" );
+ this.handles.prop( "disabled", true );
this.element.addClass( "ui-disabled" );
} else {
- this.handles.removeAttr( "disabled" );
+ this.handles.prop( "disabled", false );
this.element.removeClass( "ui-disabled" );
}
break;
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index 951b336ed..b03c59709 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -302,10 +302,10 @@ $.widget( "ui.spinner", {
if ( key === "disabled" ) {
if ( value ) {
- this.element.attr( "disabled", true );
+ this.element.prop( "disabled", true );
this.buttons.button( "disable" );
} else {
- this.element.removeAttr( "disabled" );
+ this.element.prop( "disabled", false );
this.buttons.button( "enable" );
}
}
@@ -343,7 +343,7 @@ $.widget( "ui.spinner", {
destroy: function() {
this.element
.removeClass( "ui-spinner-input" )
- .removeAttr( "disabled" )
+ .prop( "disabled", false )
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-valuemin" )