Skip to content

Commit e38feea

Browse files
committed
Merge branch 'master' into selectmenu
2 parents 682a321 + 11b026d commit e38feea

File tree

7 files changed

+25
-16
lines changed

7 files changed

+25
-16
lines changed

tests/unit/accordion/accordion_methods.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ test( "destroy", function() {
1010
});
1111

1212
test( "enable/disable", function() {
13-
expect( 3 );
13+
expect( 4 );
1414
var element = $( "#list1" ).accordion();
1515
accordion_state( element, 1, 0, 0 );
1616
element.accordion( "disable" );
17-
element.accordion( "option", "active", 1 );
17+
// event does nothing
18+
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" );
1819
accordion_state( element, 1, 0, 0 );
19-
element.accordion( "enable" );
20+
// option still works
2021
element.accordion( "option", "active", 1 );
2122
accordion_state( element, 0, 1, 0 );
23+
element.accordion( "enable" );
24+
element.accordion( "option", "active", 2 );
25+
accordion_state( element, 0, 0, 1 );
2226
});
2327

2428
test( "refresh", function() {

tests/unit/accordion/accordion_options.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ test( "{ event: custom }", function() {
152152

153153
// ensure old event handlers are unbound
154154
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
155+
element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom2" );
155156
equal( element.accordion( "option", "active" ), 2 );
156157
accordion_state( element, 0, 0, 1 );
157158

tests/unit/accordion/accordion_test_helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function accordion_state( accordion ) {
33
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
44
return $( this ).css( "display" ) === "none" ? 0 : 1;
55
}).get();
6-
deepEqual( actual, expected );
6+
QUnit.push( QUnit.equiv(actual, expected), actual, expected );
77
}
88

99
function accordion_equalHeights( accordion, min, max ) {

themes/base/jquery.ui.menu.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
.ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
1616

1717
.ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
18+
.ui-menu .ui-state-disabled a { cursor: default; }
1819

1920
/* icon support */
2021
.ui-menu-icons { position: relative; }

ui/i18n/jquery.ui.datepicker-fi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Finnish initialisation for the jQuery UI date picker plugin. */
2-
/* Written by Harri Kilpi� (harrikilpio@gmail.com). */
2+
/* Written by Harri Kilpiö (harrikilpio@gmail.com). */
33
jQuery(function($){
44
$.datepicker.regional['fi'] = {
55
closeText: 'Sulje',
@@ -10,7 +10,7 @@ jQuery(function($){
1010
'Heinäkuu','Elokuu','Syyskuu','Lokakuu','Marraskuu','Joulukuu'],
1111
monthNamesShort: ['Tammi','Helmi','Maalis','Huhti','Touko','Kesä',
1212
'Heinä','Elo','Syys','Loka','Marras','Joulu'],
13-
dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','Su'],
13+
dayNamesShort: ['Su','Ma','Ti','Ke','To','Pe','La'],
1414
dayNames: ['Sunnuntai','Maanantai','Tiistai','Keskiviikko','Torstai','Perjantai','Lauantai'],
1515
dayNamesMin: ['Su','Ma','Ti','Ke','To','Pe','La'],
1616
weekHeader: 'Vk',

ui/jquery.ui.accordion.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ $.widget( "ui.accordion", {
6868

6969
this.headers
7070
.attr( "role", "tab" )
71-
// TODO: use _bind()
72-
.bind( "keydown.accordion", $.proxy( this, "_keydown" ) )
7371
.next()
7472
.attr( "role", "tabpanel" );
7573

@@ -161,8 +159,7 @@ $.widget( "ui.accordion", {
161159

162160
if ( key === "event" ) {
163161
if ( this.options.event ) {
164-
// TODO: this is incorrect for multiple events (see _setupEvents)
165-
this.headers.unbind( this.options.event + ".accordion", this._eventHandler );
162+
this.headers.unbind( ".accordion" );
166163
}
167164
this._setupEvents( value );
168165
}
@@ -190,8 +187,7 @@ $.widget( "ui.accordion", {
190187
},
191188

192189
_keydown: function( event ) {
193-
// TODO: remove disabled check when using _bind()
194-
if ( this.options.disabled || event.altKey || event.ctrlKey ) {
190+
if ( event.altKey || event.ctrlKey ) {
195191
return;
196192
}
197193

@@ -300,11 +296,15 @@ $.widget( "ui.accordion", {
300296
},
301297

302298
_setupEvents: function( event ) {
299+
var events = {
300+
keydown: "_keydown"
301+
};
303302
if ( event ) {
304-
// TODO: use _bind()
305-
this.headers.bind( event.split( " " ).join( ".accordion " ) + ".accordion",
306-
$.proxy( this, "_eventHandler" ) );
303+
$.each( event.split(" "), function( index, eventName ) {
304+
events[ eventName ] = "_eventHandler";
305+
});
307306
}
307+
this._bind( this.headers, events );
308308
},
309309

310310
_eventHandler: function( event ) {
@@ -324,7 +324,7 @@ $.widget( "ui.accordion", {
324324

325325
event.preventDefault();
326326

327-
if ( options.disabled ||
327+
if (
328328
// click on active header, but not collapsible
329329
( clickedIsActive && !options.collapsible ) ||
330330
// allow canceling activation

ui/jquery.ui.menu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ $.widget( "ui.menu", {
5959
"mousedown .ui-menu-item > a": function( event ) {
6060
event.preventDefault();
6161
},
62+
"click .ui-state-disabled > a": function( event ) {
63+
event.preventDefault();
64+
},
6265
"click .ui-menu-item:has(a)": function( event ) {
6366
event.stopImmediatePropagation();
6467
//Don't select disabled menu items

0 commit comments

Comments
 (0)