Skip to content
Permalink
Browse files

Merge branch 'master' into selectmenu

  • Loading branch information...
fnagel committed Apr 29, 2013
2 parents f96ee5e + 5c0a6aa commit 6640925db2f326932bc7d2ef76f4cd96930e92bd
@@ -39,8 +39,8 @@ grunt.registerTask( "manifest", "Generate jquery.json manifest files", function(
name: "ui.effect-{plugin}",
title: "jQuery UI {Plugin} Effect",
keywords: [ "effect", "show", "hide" ],
homepage: "http://jqueryui.com/{plugin}-effect/",
demo: "http://jqueryui.com/{plugin}-effect/",
homepage: "http://jqueryui.com/effect/",
demo: "http://jqueryui.com/effect/",
docs: "http://api.jqueryui.com/{plugin}-effect/",
dependencies: [ "effect" ]
}
@@ -95,7 +95,7 @@
</select>
<select id="my_vertical">
<option value="top">top</option>
<option value="middle">center</option>
<option value="center">center</option>
<option value="bottom">bottom</option>
</select>
</div>
@@ -108,7 +108,7 @@
</select>
<select id="at_vertical">
<option value="top">top</option>
<option value="middle">center</option>
<option value="center">center</option>
<option value="bottom">bottom</option>
</select>
</div>
@@ -2,7 +2,7 @@
"name": "jquery-ui",
"title": "jQuery UI",
"description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.",
"version": "1.10.3pre",
"version": "1.11.0pre",
"homepage": "http://jqueryui.com",
"author": {
"name": "jQuery Foundation and other contributors",
@@ -89,6 +89,30 @@ test( "allow form submit on enter when menu is not active", function() {
test( "down arrow moves focus - contenteditable", function() {
arrowsMoveFocus( "#autocomplete-contenteditable", false );
});

test( "up arrow moves cursor - input", function() {
arrowsNavigateElement( "#autocomplete", true, false );
});

test( "down arrow moves cursor - input", function() {
arrowsNavigateElement( "#autocomplete", false, false );
});

test( "up arrow moves cursor - textarea", function() {
arrowsNavigateElement( "#autocomplete-textarea", true, true );
});

test( "down arrow moves cursor - textarea", function() {
arrowsNavigateElement( "#autocomplete-textarea", false, true );
});

test( "up arrow moves cursor - contenteditable", function() {
arrowsNavigateElement( "#autocomplete-contenteditable", true, true );
});

test( "down arrow moves cursor - contenteditable", function() {
arrowsNavigateElement( "#autocomplete-contenteditable", false, true );
});

function arrowsInvokeSearch( id, isKeyUp, shouldMove ) {
expect( 1 );
@@ -120,6 +144,23 @@ test( "allow form submit on enter when menu is not active", function() {
element.autocomplete( "search" );
element.simulate( "keydown", { keyCode: ( isKeyUp ? $.ui.keyCode.UP : $.ui.keyCode.DOWN ) } );
}

function arrowsNavigateElement( id, isKeyUp, shouldMove ) {
expect( 1 );

var didMove = false,
element = $( id ).autocomplete({
source: [ "a" ],
delay: 0,
minLength: 0
});
element.on( "keypress", function( e ) {
didMove = !e.isDefaultPrevented();
});
element.simulate( "keydown", { keyCode: ( isKeyUp ? $.ui.keyCode.UP : $.ui.keyCode.DOWN ) } );
element.simulate( "keypress" );
equal( didMove, shouldMove, "respond to arrow" );
}
})();

asyncTest( "handle race condition", function() {
@@ -23,6 +23,8 @@
margin: 0;
padding: 0;
width: 100%;
/* support: IE10, see #8844 */
list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);
}
.ui-menu .ui-menu-divider {
margin: 5px -2px 5px -2px;
@@ -169,7 +169,6 @@ $.widget( "ui.accordion", {
},

_keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( event.altKey || event.ctrlKey ) {
return;
}
@@ -16,9 +16,6 @@
*/
(function( $, undefined ) {

// used to prevent race conditions with remote data sources
var requestIndex = 0;

$.widget( "ui.autocomplete", {
version: "@VERSION",
defaultElement: "<input>",
@@ -77,7 +74,6 @@ $.widget( "ui.autocomplete", {

this._on( this.element, {
keydown: function( event ) {
/*jshint maxcomplexity:15*/
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
@@ -142,7 +138,9 @@ $.widget( "ui.autocomplete", {
keypress: function( event ) {
if ( suppressKeyPress ) {
suppressKeyPress = false;
event.preventDefault();
if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
event.preventDefault();
}
return;
}
if ( suppressKeyPressRepeat ) {
@@ -417,21 +415,24 @@ $.widget( "ui.autocomplete", {
this.source( { term: value }, this._response() );
},

_response: function() {
var that = this,
index = ++requestIndex;
_response: (function() {
var requestIndex = 0;

return function( content ) {
if ( index === requestIndex ) {
that.__response( content );
}
return function() {
var index = ++requestIndex;

that.pending--;
if ( !that.pending ) {
that.element.removeClass( "ui-autocomplete-loading" );
}
return $.proxy(function( content ) {
if ( index === requestIndex ) {
this.__response( content );
}

this.pending--;
if ( !this.pending ) {
this.element.removeClass( "ui-autocomplete-loading" );
}
}, this );
};
},
})(),

__response: function( content ) {
if ( content ) {
@@ -556,7 +556,6 @@ $.widget( "ui.dialog", {
},

_setOption: function( key, value ) {
/*jshint maxcomplexity:15*/
var isDraggable, isResizable,
uiDialog = this.uiDialog;

@@ -174,7 +174,6 @@ $.widget( "ui.menu", {
},

_keydown: function( event ) {
/*jshint maxcomplexity:20*/
var match, prev, character, skip, regex,
preventDefault = true;

@@ -593,7 +593,6 @@ $.widget( "ui.slider", $.ui.mouse, {

_handleEvents: {
keydown: function( event ) {
/*jshint maxcomplexity:25*/
var allowed, curVal, newVal, step,
index = $( event.target ).data( "ui-slider-handle-index" );

@@ -15,8 +15,6 @@
*/
(function( $, undefined ) {

/*jshint loopfunc: true */

function isOverAxis( x, reference, size ) {
return ( x > reference ) && ( x < ( reference + size ) );
}
@@ -629,10 +627,11 @@ $.widget("ui.sortable", $.ui.mouse, {

queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);

function addItems() {
items.push( this );
}
for (i = queries.length - 1; i >= 0; i--){
queries[i][0].each(function() {
items.push(this);
});
queries[i][0].each( addItems );
}

return $(items);
@@ -1190,12 +1189,17 @@ $.widget("ui.sortable", $.ui.mouse, {


//Post events to containers
function delayEvent( type, instance, container ) {
return function( event ) {
container._trigger( type, event, instance._uiHash( instance ) );
};
}
for (i = this.containers.length - 1; i >= 0; i--){
if(!noPropagation) {
delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
if (!noPropagation) {
delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) );
}
if(this.containers[i].containerCache.over) {
delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) );
this.containers[i].containerCache.over = 0;
}
}
@@ -150,7 +150,6 @@ $.widget( "ui.tabs", {
},

_tabKeydown: function( event ) {
/*jshint maxcomplexity:15*/
var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
selectedIndex = this.tabs.index( focusedTab ),
goingForward = true;

0 comments on commit 6640925

Please sign in to comment.
You can’t perform that action at this time.