Skip to content

Commit 1b885ff

Browse files
committed
Merge branch 'master' into datepicker
# Conflicts: # ui/i18n/datepicker-pt.js
2 parents 2b611ba + 74f8a0a commit 1b885ff

30 files changed

+472
-232
lines changed

demos/autocomplete/combobox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
.autocomplete({
4949
delay: 0,
5050
minLength: 0,
51-
source: $.proxy( this, "_source" )
51+
source: this._source.bind( this )
5252
})
5353
.tooltip({
5454
classes: {

demos/effect/easing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
canvas.width = width;
3535
canvas.height = height;
3636
var drawHeight = height * 0.8,
37-
cradius = 10;
37+
cradius = 10,
3838
ctx = canvas.getContext( "2d" );
3939
ctx.fillStyle = "black";
4040

tests/lib/bootstrap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ function migrateUrl() {
181181
}
182182
}
183183

184-
// Load the jQuery 1.7 fixes, if necessary
185-
if ( parseFloat( parseUrl().jquery ) === 1.7 ) {
186-
modules.push( "ui/jquery-1-7" );
184+
// Load the jQuery fixes, if necessary
185+
if ( parseFloat( parseUrl().jquery ) < 3 ) {
186+
modules.unshift( "ui/jquery-1-7" );
187187
}
188188

189189
requireTests( modules, noBackCompat );

tests/lib/qunit-assert-domequal.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ domEqual.attributes = [
5959
"title"
6060
];
6161

62+
function camelCase( string ) {
63+
return string.replace( /-([\da-z])/gi, function( all, letter ) {
64+
return letter.toUpperCase();
65+
} );
66+
}
67+
6268
function getElementStyles( elem ) {
6369
var styles = {};
6470
var style = elem.ownerDocument.defaultView ?
@@ -71,7 +77,7 @@ function getElementStyles( elem ) {
7177
while ( len-- ) {
7278
key = style[ len ];
7379
if ( typeof style[ key ] === "string" ) {
74-
styles[ $.camelCase( key ) ] = style[ key ];
80+
styles[ camelCase( key ) ] = style[ key ];
7581
}
7682
}
7783

tests/unit/button/deprecated.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@
5656
<button id="button1">Button</button>
5757
<a href="#" id="anchor-button">Anchor Button</a>
5858

59+
<div class="mixed">
60+
<a href="#" id="mixed-anchor">Anchor</a>
61+
<button id="mixed-button" disabled>Button</button>
62+
<input type="button" value="Button" id="mixed-input">
63+
<input type="checkbox" id="mixed-check" name="check"><label for="mixed-check">Check</label>
64+
<input type="radio" id="mixed-radio" name="radio"><label for="mixed-radio">Radio</label>
65+
</div>
66+
5967
</div>
6068
</body>
6169
</html>

tests/unit/button/deprecated.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,22 @@ QUnit.test( "icon / icons options properly proxied", function( assert ) {
194194
"Icons secondary option sets iconPosition option to end on init" );
195195
} );
196196

197+
QUnit.test( "Calling button on a collection of mixed types works correctly", function( assert ) {
198+
assert.expect( 5 );
199+
200+
var group = $( ".mixed" ).children();
201+
202+
group.button();
203+
204+
$.each( {
205+
anchor: "button",
206+
button: "button",
207+
check: "checkboxradio",
208+
input: "button",
209+
radio: "checkboxradio"
210+
}, function( type, widget ) {
211+
assert.ok( $( "#mixed-" + type )[ widget ]( "instance" ), type + " is a " + widget );
212+
} );
213+
} );
214+
197215
} );

tests/unit/core/core.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ QUnit.test( "uniqueId / removeUniqueId", function( assert ) {
142142
} );
143143

144144
QUnit.test( "Labels", function( assert ) {
145-
assert.expect( 2 );
145+
assert.expect( 3 );
146146

147147
var expected = [ "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" ];
148148
var dom = $( "#labels-fragment" );
@@ -165,6 +165,8 @@ QUnit.test( "Labels", function( assert ) {
165165
// Detach the dom to test on a fragment
166166
dom.detach();
167167
testLabels( "document fragments" );
168+
169+
assert.equal( $().labels().length, 0, "No element" );
168170
} );
169171

170172
( function() {

tests/unit/menu/events.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,9 @@ QUnit.test( "handle keyboard navigation and mouse click on menu with dividers an
670670
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
671671
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
672672
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
673-
assert.equal( logOutput(), "keydown,3,4,7", "Keydown focus skips divider and group label" );
673+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
674+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
675+
assert.equal( logOutput(), "keydown,1,2,3,4,7", "Keydown focus skips divider and group label" );
674676
ready();
675677
}
676678
} );
@@ -755,4 +757,26 @@ QUnit.test( "#10571: When typing in a menu, only menu-items should be focused",
755757
} );
756758
} );
757759

760+
QUnit.test( "#15157: Must not focus menu dividers with the keyboard", function( assert ) {
761+
var ready = assert.async();
762+
assert.expect( 6 );
763+
764+
var element = $( "#menu-with-dividers" ).menu( {
765+
focus: function( event, ui ) {
766+
assert.hasClasses( ui.item, "ui-menu-item", "Should have menu item class" );
767+
log( ui.item.text() );
768+
}
769+
} );
770+
771+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
772+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
773+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
774+
element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
775+
element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
776+
setTimeout( function() {
777+
assert.equal( logOutput(), "beginning,middle,end,beginning,end", "Should wrap around items" );
778+
ready();
779+
} );
780+
} );
781+
758782
} );

tests/unit/menu/menu.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@
323323
<li class="foo"><div>Addyston</div></li>
324324
<li class="foo"><div>Adelphi</div></li>
325325
</ul>
326+
327+
<ul id="menu-with-dividers">
328+
<li>-</li>
329+
<li>beginning</li>
330+
<li>-</li>
331+
<li>middle</li>
332+
<li>-</li>
333+
<li>end</li>
334+
<li>-</li>
335+
</ul>
326336
</div>
327337
</body>
328338
</html>

tests/unit/resizable/options.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,10 @@ QUnit.test( "zIndex, applied to all handles", function( assert ) {
434434
} );
435435

436436
QUnit.test( "setOption handles", function( assert ) {
437-
assert.expect( 15 );
437+
assert.expect( 19 );
438438

439+
// https://bugs.jqueryui.com/ticket/3423
440+
// https://bugs.jqueryui.com/ticket/15084
439441
var target = $( "<div></div>" ).resizable(),
440442
target2 = $( "<div>" +
441443
"<div class='ui-resizable-handle ui-resizable-e'></div>" +
@@ -470,6 +472,12 @@ QUnit.test( "setOption handles", function( assert ) {
470472

471473
target2.resizable( "option", "handles", "e, s, w" );
472474
checkHandles( target2, [ "e", "s", "w" ] );
475+
476+
target.resizable( "destroy" );
477+
checkHandles( target, [ ] );
478+
479+
target2.resizable( "destroy" );
480+
checkHandles( target2, [ "e", "w" ] );
473481
} );
474482

475483
QUnit.test( "alsoResize + containment", function( assert ) {

0 commit comments

Comments
 (0)