Skip to content

Commit 57fa482

Browse files
committed
Merge branch 'master' into selectmenu
2 parents bfd3c4a + 6997569 commit 57fa482

File tree

6 files changed

+232
-146
lines changed

6 files changed

+232
-146
lines changed

tests/unit/autocomplete/autocomplete_core.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,34 @@ asyncTest( "handle race condition", function() {
192192
}
193193
});
194194

195+
asyncTest( "simultaneous searches (#9334)", function() {
196+
expect( 2 );
197+
var element = $( "#autocomplete" ).autocomplete({
198+
source: function( request, response ) {
199+
setTimeout(function() {
200+
response([ request.term ]);
201+
});
202+
},
203+
response: function() {
204+
ok( true, "response from first instance" );
205+
}
206+
}),
207+
element2 = $( "#autocomplete-textarea" ).autocomplete({
208+
source: function( request, response ) {
209+
setTimeout(function() {
210+
response([ request.term ]);
211+
});
212+
},
213+
response: function() {
214+
ok( true, "response from second instance" );
215+
start();
216+
}
217+
});
218+
219+
element.autocomplete( "search", "test" );
220+
element2.autocomplete( "search", "test" );
221+
});
222+
195223
test( "ARIA", function() {
196224
expect( 7 );
197225
var element = $( "#autocomplete" ).autocomplete({

tests/unit/resizable/resizable_events.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,51 @@ test("stop", function() {
170170

171171
});
172172

173+
test( "resize (containment) works with parent with negative offset", function() {
174+
175+
expect( 1 );
176+
177+
var widthBefore, widthAfter,
178+
handle = ".ui-resizable-e",
179+
target = $( "#resizable1" ),
180+
absoluteContainer = target.wrap( "<div />" ).parent(),
181+
fixedContainer = absoluteContainer.wrap( "<div />" ).parent(),
182+
increaseWidthBy = 50;
183+
184+
// position fixed container in window top left
185+
fixedContainer.css({
186+
width: 400,
187+
height: 100,
188+
position: "fixed",
189+
top: 0,
190+
left: 0
191+
});
192+
193+
// position absolute container within fixed on slightly outside window
194+
absoluteContainer.css({
195+
width: 400,
196+
height: 100,
197+
position: "absolute",
198+
top: 0,
199+
left: -50
200+
});
201+
202+
// set up resizable to be contained within absolute container
203+
target.resizable({
204+
handles: "all",
205+
containment: "parent"
206+
}).css({
207+
width: 300
208+
});
209+
210+
widthBefore = target.width();
211+
212+
TestHelpers.resizable.drag( handle, increaseWidthBy, 0 );
213+
214+
widthAfter = target.width();
215+
216+
equal( widthAfter, ( widthBefore + increaseWidthBy ), "resizable width should be increased by the value dragged" );
217+
218+
});
219+
173220
})(jQuery);

themes/base/jquery.ui.accordion.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
.ui-accordion .ui-accordion-icons {
2020
padding-left: 2.2em;
2121
}
22-
.ui-accordion .ui-accordion-noicons {
23-
padding-left: .7em;
24-
}
2522
.ui-accordion .ui-accordion-icons .ui-accordion-icons {
2623
padding-left: 2.2em;
2724
}

ui/jquery.ui.autocomplete.js

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ $.widget( "ui.autocomplete", {
4141
select: null
4242
},
4343

44+
requestIndex: 0,
4445
pending: 0,
4546

4647
_create: function() {
@@ -414,24 +415,20 @@ $.widget( "ui.autocomplete", {
414415
this.source( { term: value }, this._response() );
415416
},
416417

417-
_response: (function() {
418-
var requestIndex = 0;
418+
_response: function() {
419+
var index = ++this.requestIndex;
419420

420-
return function() {
421-
var index = ++requestIndex;
422-
423-
return $.proxy(function( content ) {
424-
if ( index === requestIndex ) {
425-
this.__response( content );
426-
}
421+
return $.proxy(function( content ) {
422+
if ( index === this.requestIndex ) {
423+
this.__response( content );
424+
}
427425

428-
this.pending--;
429-
if ( !this.pending ) {
430-
this.element.removeClass( "ui-autocomplete-loading" );
431-
}
432-
}, this );
433-
};
434-
})(),
426+
this.pending--;
427+
if ( !this.pending ) {
428+
this.element.removeClass( "ui-autocomplete-loading" );
429+
}
430+
}, this );
431+
},
435432

436433
__response: function( content ) {
437434
if ( content ) {

0 commit comments

Comments
 (0)