From c36b43d0ee3cf7e10d82d21e3a4ca6cb954f4c16 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Thu, 15 Sep 2011 17:02:18 -0700 Subject: Datepicker: Fix `this` reference in _hideDatepicker(). Fixed #7722 - Datepicker: Does not properly clear current instance when hidden. --- ui/jquery.ui.datepicker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 0b6fb2218..a5ff08c63 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -807,9 +807,10 @@ $.extend(Datepicker.prototype, { if (this._datepickerShowing) { var showAnim = this._get(inst, 'showAnim'); var duration = this._get(inst, 'duration'); + var self = this; var postProcess = function() { $.datepicker._tidyDialog(inst); - this._curInst = null; + self._curInst = null; }; // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed -- cgit v1.2.3 From 93214d6ddccb04e521db2cd40feeb6be70bf80a7 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 Nov 2011 08:43:08 -0500 Subject: Widget tests: Fixed _super() call in redefine test. --- tests/unit/widget/widget_core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index edf1ae0fc..2e55ad703 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -1031,7 +1031,7 @@ test( "redefine", function() { $.widget( "ui.testWidget", $.ui.testWidget, { method: function( str ) { equal( str, "foo", "new invoked with correct parameter" ); - this._super(); + this._super( "bar" ); } }); -- cgit v1.2.3 From 91ef69d7503f11f2b6223b9c0061fca51e3a006f Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 Nov 2011 11:14:19 -0500 Subject: Widget: Don't use $.event.props when creating events. --- ui/jquery.ui.widget.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 53cde389e..0d52fb534 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -374,29 +374,28 @@ $.Widget.prototype = { }, _trigger: function( type, event, data ) { - var callback = this.options[ type ], - args; + var args, prop, orig, + callback = this.options[ type ]; + data = data || {}; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); - data = data || {}; + // the original event may come from any element + // so we need to reset the target on the new event + event.target = this.element[ 0 ]; // copy original event properties over to the new event - // this would happen if we could call $.event.fix instead of $.Event - // but we don't have a way to force an event to be fixed multiple times - if ( event.originalEvent ) { - for ( var i = $.event.props.length, prop; i; ) { - prop = $.event.props[ --i ]; - event[ prop ] = event.originalEvent[ prop ]; + orig = event.originalEvent; + if ( orig ) { + for ( prop in orig ) { + if ( !( prop in event ) ) { + event[ prop ] = orig[ prop ]; + } } } - // the original event may come from any element - // so we need to reset the target on the new event - event.target = this.element[0]; - this.element.trigger( event, data ); args = $.isArray( data ) ? -- cgit v1.2.3 From 5fb9629766f10a9119e0099bd8aee06f86cc3f30 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 21 Nov 2011 11:31:51 -0500 Subject: Widget: Simplify data normalization in _trigger(). --- ui/jquery.ui.widget.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 0d52fb534..4f47a008b 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -374,7 +374,7 @@ $.Widget.prototype = { }, _trigger: function( type, event, data ) { - var args, prop, orig, + var prop, orig, callback = this.options[ type ]; data = data || {}; @@ -397,13 +397,8 @@ $.Widget.prototype = { } this.element.trigger( event, data ); - - args = $.isArray( data ) ? - [ event ].concat( data ) : - [ event, data ]; - return !( $.isFunction( callback ) && - callback.apply( this.element[0], args ) === false || + callback.apply( this.element[0], [ event ].concat( data ) ) === false || event.isDefaultPrevented() ); } }; -- cgit v1.2.3 From fdc332ed5fb7f7e688151d5cae9b450569d73da5 Mon Sep 17 00:00:00 2001 From: "Michael P. Jung" Date: Mon, 21 Nov 2011 16:16:32 -0500 Subject: Droppable: Make sure._drop is called for all relevant droppables. Fixes #6009 - Upper droppable should receive draggable. Fixes #6085 - Parent droppable takes precedence over dynamically created child droppable. --- ui/jquery.ui.droppable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 3942c6b8f..62bba2aba 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -224,7 +224,7 @@ $.ui.ddmanager = { if(!this.options) return; if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance)) - dropped = dropped || this._drop.call(this, event); + dropped = this._drop.call(this, event) || dropped; if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) { this.isout = 1; this.isover = 0; -- cgit v1.2.3 From 35dd0417bdb442ad00a9eb37a85db5ddf1b14615 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 22 Nov 2011 08:31:11 -0500 Subject: Selectable: Explicitly check event.ctrlKey now that jQuery differentiates between meta and ctrl. Fixes #7858 - ctrl-click to select multiple elements not working. --- ui/jquery.ui.selectable.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js index d7b24d4e3..408771eff 100644 --- a/ui/jquery.ui.selectable.js +++ b/ui/jquery.ui.selectable.js @@ -104,7 +104,7 @@ $.widget("ui.selectable", $.ui.mouse, { this.selectees.filter('.ui-selected').each(function() { var selectee = $.data(this, "selectable-item"); selectee.startselected = true; - if (!event.metaKey) { + if (!event.metaKey && !event.ctrlKey) { selectee.$element.removeClass('ui-selected'); selectee.selected = false; selectee.$element.addClass('ui-unselecting'); @@ -119,7 +119,7 @@ $.widget("ui.selectable", $.ui.mouse, { $(event.target).parents().andSelf().each(function() { var selectee = $.data(this, "selectable-item"); if (selectee) { - var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected'); + var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected'); selectee.$element .removeClass(doSelect ? "ui-unselecting" : "ui-selected") .addClass(doSelect ? "ui-selecting" : "ui-unselecting"); @@ -189,7 +189,7 @@ $.widget("ui.selectable", $.ui.mouse, { } else { // UNSELECT if (selectee.selecting) { - if (event.metaKey && selectee.startselected) { + if ((event.metaKey || event.ctrlKey) && selectee.startselected) { selectee.$element.removeClass('ui-selecting'); selectee.selecting = false; selectee.$element.addClass('ui-selected'); @@ -208,7 +208,7 @@ $.widget("ui.selectable", $.ui.mouse, { } } if (selectee.selected) { - if (!event.metaKey && !selectee.startselected) { + if (!event.metaKey && !event.ctrlKey && !selectee.startselected) { selectee.$element.removeClass('ui-selected'); selectee.selected = false; -- cgit v1.2.3 From 54fb1441fe2f9595a8376b9f4bf7d766469f5045 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 22 Nov 2011 08:43:09 -0500 Subject: Upgrade jQuery to 1.7.1. --- demos/accordion/collapsible.html | 2 +- demos/accordion/custom-icons.html | 2 +- demos/accordion/default.html | 2 +- demos/accordion/fillspace.html | 2 +- demos/accordion/hoverintent.html | 2 +- demos/accordion/mouseover.html | 2 +- demos/accordion/no-auto-height.html | 2 +- demos/accordion/sortable.html | 2 +- demos/addClass/default.html | 2 +- demos/animate/default.html | 2 +- demos/autocomplete/categories.html | 2 +- demos/autocomplete/combobox.html | 2 +- demos/autocomplete/custom-data.html | 2 +- demos/autocomplete/default.html | 2 +- demos/autocomplete/folding.html | 2 +- demos/autocomplete/maxheight.html | 2 +- demos/autocomplete/multiple-remote.html | 2 +- demos/autocomplete/multiple.html | 2 +- demos/autocomplete/remote-jsonp.html | 2 +- demos/autocomplete/remote-with-cache.html | 2 +- demos/autocomplete/remote.html | 2 +- demos/autocomplete/xml.html | 2 +- demos/button/checkbox.html | 2 +- demos/button/default.html | 2 +- demos/button/icons.html | 2 +- demos/button/radio.html | 2 +- demos/button/splitbutton.html | 2 +- demos/button/toolbar.html | 2 +- demos/datepicker/alt-field.html | 2 +- demos/datepicker/animation.html | 2 +- demos/datepicker/buttonbar.html | 2 +- demos/datepicker/date-formats.html | 2 +- demos/datepicker/date-range.html | 2 +- demos/datepicker/default.html | 2 +- demos/datepicker/dropdown-month-year.html | 2 +- demos/datepicker/icon-trigger.html | 2 +- demos/datepicker/inline.html | 2 +- demos/datepicker/localization.html | 2 +- demos/datepicker/min-max.html | 2 +- demos/datepicker/multiple-calendars.html | 2 +- demos/datepicker/other-months.html | 2 +- demos/datepicker/show-week.html | 2 +- demos/dialog/animated.html | 2 +- demos/dialog/default.html | 2 +- demos/dialog/modal-confirmation.html | 2 +- demos/dialog/modal-form.html | 2 +- demos/dialog/modal-message.html | 2 +- demos/dialog/modal.html | 2 +- demos/draggable/constrain-movement.html | 2 +- demos/draggable/cursor-style.html | 2 +- demos/draggable/default.html | 2 +- demos/draggable/delay-start.html | 2 +- demos/draggable/events.html | 2 +- demos/draggable/handle.html | 2 +- demos/draggable/revert.html | 2 +- demos/draggable/scroll.html | 2 +- demos/draggable/snap-to.html | 2 +- demos/draggable/sortable.html | 2 +- demos/draggable/visual-feedback.html | 2 +- demos/droppable/accepted-elements.html | 2 +- demos/droppable/default.html | 2 +- demos/droppable/photo-manager.html | 2 +- demos/droppable/propagation.html | 2 +- demos/droppable/revert.html | 2 +- demos/droppable/shopping-cart.html | 2 +- demos/droppable/visual-feedback.html | 2 +- demos/effect/default.html | 2 +- demos/effect/easing.html | 2 +- demos/hide/default.html | 2 +- demos/index.html | 2 +- demos/menu/contextmenu.html | 2 +- demos/menu/default.html | 2 +- demos/menu/navigationmenu.html | 2 +- demos/menu/topalignmenu.html | 2 +- demos/menubar/default.html | 2 +- demos/popup/animation.html | 2 +- demos/popup/default.html | 2 +- demos/popup/popup-menu-table.html | 2 +- demos/popup/popup-menu.html | 2 +- demos/popup/tooltip.html | 2 +- demos/position/cycler.html | 2 +- demos/position/default.html | 2 +- demos/progressbar/animated.html | 2 +- demos/progressbar/default.html | 2 +- demos/progressbar/resize.html | 2 +- demos/removeClass/default.html | 2 +- demos/resizable/animate.html | 2 +- demos/resizable/aspect-ratio.html | 2 +- demos/resizable/constrain-area.html | 2 +- demos/resizable/default.html | 2 +- demos/resizable/delay-start.html | 2 +- demos/resizable/helper.html | 2 +- demos/resizable/max-min.html | 2 +- demos/resizable/snap-to-grid.html | 2 +- demos/resizable/synchronous-resize.html | 2 +- demos/resizable/textarea.html | 2 +- demos/resizable/visual-feedback.html | 2 +- demos/selectable/default.html | 2 +- demos/selectable/display-grid.html | 2 +- demos/selectable/serialize.html | 2 +- demos/show/default.html | 2 +- demos/slider/colorpicker.html | 2 +- demos/slider/default.html | 2 +- demos/slider/hotelrooms.html | 2 +- demos/slider/multiple-vertical.html | 2 +- demos/slider/range-vertical.html | 2 +- demos/slider/range.html | 2 +- demos/slider/rangemax.html | 2 +- demos/slider/rangemin.html | 2 +- demos/slider/side-scroll.html | 2 +- demos/slider/slider-vertical.html | 2 +- demos/slider/steps.html | 2 +- demos/slider/tabs.html | 2 +- demos/sortable/connect-lists-through-tabs.html | 2 +- demos/sortable/connect-lists.html | 2 +- demos/sortable/default.html | 2 +- demos/sortable/delay-start.html | 2 +- demos/sortable/display-grid.html | 2 +- demos/sortable/empty-lists.html | 2 +- demos/sortable/items.html | 2 +- demos/sortable/placeholder.html | 2 +- demos/sortable/portlets.html | 2 +- demos/spinner/currency.html | 2 +- demos/spinner/decimal.html | 2 +- demos/spinner/default.html | 2 +- demos/spinner/latlong.html | 2 +- demos/spinner/overflow.html | 2 +- demos/spinner/time.html | 2 +- demos/switchClass/default.html | 2 +- demos/tabs/ajax.html | 2 +- demos/tabs/bottom.html | 2 +- demos/tabs/collapsible.html | 2 +- demos/tabs/cookie.html | 2 +- demos/tabs/default.html | 2 +- demos/tabs/manipulation.html | 2 +- demos/tabs/mouseover.html | 2 +- demos/tabs/sortable.html | 2 +- demos/tabs/vertical.html | 2 +- demos/toggle/default.html | 2 +- demos/toggleClass/default.html | 2 +- demos/tooltip/custom-animation.html | 2 +- demos/tooltip/custom-content.html | 2 +- demos/tooltip/custom-style.html | 2 +- demos/tooltip/default.html | 2 +- demos/tooltip/forms.html | 2 +- demos/tooltip/tracking.html | 2 +- demos/tooltip/video-player.html | 2 +- demos/widget/default.html | 2 +- jquery-1.7.1.js | 9266 +++++++++++++++++++ jquery-1.7.js | 9300 -------------------- tests/index.html | 2 +- tests/jquery-1.7.1.js | 9266 +++++++++++++++++++ tests/jquery.js | 2 +- tests/static/button/default.html | 2 +- tests/static/datepicker/datepicker.html | 2 +- tests/static/datepicker/default.html | 2 +- tests/static/icons.html | 2 +- tests/static/slider/default.html | 2 +- tests/static/slider/default_vertical.html | 2 +- tests/static/slider/slider_horizontal.html | 2 +- tests/static/slider/slider_horizontal_range.html | 2 +- .../static/slider/slider_horizontal_range_max.html | 2 +- .../static/slider/slider_horizontal_range_min.html | 2 +- tests/static/slider/slider_vertical.html | 2 +- tests/static/slider/slider_vertical_range.html | 2 +- tests/static/slider/slider_vertical_range_max.html | 2 +- tests/static/slider/slider_vertical_range_min.html | 2 +- tests/unit/accordion/all.html | 2 +- tests/unit/all.html | 2 +- tests/unit/autocomplete/all.html | 2 +- tests/unit/button/all.html | 2 +- tests/unit/core/all.html | 2 +- tests/unit/datepicker/all.html | 2 +- tests/unit/dialog/all.html | 2 +- tests/unit/draggable/all.html | 2 +- tests/unit/droppable/all.html | 2 +- tests/unit/effects/all.html | 2 +- tests/unit/menu/all.html | 2 +- tests/unit/position/all.html | 2 +- tests/unit/progressbar/all.html | 2 +- tests/unit/resizable/all.html | 2 +- tests/unit/selectable/all.html | 2 +- tests/unit/slider/all.html | 2 +- tests/unit/sortable/all.html | 2 +- tests/unit/spinner/all.html | 2 +- tests/unit/subsuite.js | 2 +- tests/unit/tabs/all.html | 2 +- tests/unit/tooltip/all.html | 2 +- tests/unit/widget/all.html | 2 +- tests/visual/addClass/addClass_queue.html | 2 +- tests/visual/button/button.html | 2 +- tests/visual/button/button_disabled_true.html | 2 +- tests/visual/button/button_performance.html | 2 +- tests/visual/button/button_ticket_5254.html | 2 +- tests/visual/button/button_ticket_5261.html | 2 +- tests/visual/button/button_ticket_5278.html | 2 +- tests/visual/compound/accordion_dialog.html | 2 +- tests/visual/compound/accordion_tabs.html | 2 +- tests/visual/compound/datepicker_dialog.html | 2 +- tests/visual/compound/draggable_accordion.html | 2 +- ...aggable_accordion_accordion_tabs_draggable.html | 2 +- .../compound/sortable_accordion_sortable_tabs.html | 2 +- tests/visual/compound/tabs_tabs.html | 2 +- tests/visual/compound/tabs_tooltips.html | 2 +- tests/visual/compound/widgets_in_dialog.html | 2 +- .../dialog/dialog_on_page_with_large_dom.html | 2 +- tests/visual/effects/effects.all.html | 2 +- tests/visual/effects/effects.scale.html | 2 +- tests/visual/menu/drilldown.html | 2 +- tests/visual/menu/menu.html | 2 +- tests/visual/menu/tablemenu.html | 2 +- tests/visual/position/position.html | 2 +- tests/visual/position/position_fit.html | 2 +- tests/visual/position/position_flip.html | 2 +- tests/visual/position/position_flipfit.html | 2 +- tests/visual/position/position_margin.html | 2 +- tests/visual/position/position_within.html | 2 +- tests/visual/theme.html | 2 +- tests/visual/tooltip/animations.html | 2 +- tests/visual/tooltip/callout.html | 2 +- tests/visual/tooltip/tooltip.html | 2 +- 221 files changed, 18750 insertions(+), 9518 deletions(-) create mode 100644 jquery-1.7.1.js delete mode 100644 jquery-1.7.js create mode 100644 tests/jquery-1.7.1.js diff --git a/demos/accordion/collapsible.html b/demos/accordion/collapsible.html index 85789e6c6..310e550a9 100644 --- a/demos/accordion/collapsible.html +++ b/demos/accordion/collapsible.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Collapse content - + diff --git a/demos/accordion/custom-icons.html b/demos/accordion/custom-icons.html index 2351b9bb0..e2fc9bdb1 100644 --- a/demos/accordion/custom-icons.html +++ b/demos/accordion/custom-icons.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Customize icons - + diff --git a/demos/accordion/default.html b/demos/accordion/default.html index 99f17df4d..4afc2b129 100644 --- a/demos/accordion/default.html +++ b/demos/accordion/default.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Default functionality - + diff --git a/demos/accordion/fillspace.html b/demos/accordion/fillspace.html index bcbf6404d..3a7d81edc 100644 --- a/demos/accordion/fillspace.html +++ b/demos/accordion/fillspace.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Fill space - + diff --git a/demos/accordion/hoverintent.html b/demos/accordion/hoverintent.html index e39fb6d52..09360d62d 100644 --- a/demos/accordion/hoverintent.html +++ b/demos/accordion/hoverintent.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Open on hoverintent - + diff --git a/demos/accordion/mouseover.html b/demos/accordion/mouseover.html index bd19ddd4e..6f4bc2e69 100644 --- a/demos/accordion/mouseover.html +++ b/demos/accordion/mouseover.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Open on mouseover - + diff --git a/demos/accordion/no-auto-height.html b/demos/accordion/no-auto-height.html index e349d1a94..c51880b71 100644 --- a/demos/accordion/no-auto-height.html +++ b/demos/accordion/no-auto-height.html @@ -4,7 +4,7 @@ jQuery UI Accordion - No auto height - + diff --git a/demos/accordion/sortable.html b/demos/accordion/sortable.html index 0afa3057b..a0a899344 100644 --- a/demos/accordion/sortable.html +++ b/demos/accordion/sortable.html @@ -4,7 +4,7 @@ jQuery UI Accordion - Sortable - + diff --git a/demos/addClass/default.html b/demos/addClass/default.html index 7de7c56f5..38acd8b4c 100644 --- a/demos/addClass/default.html +++ b/demos/addClass/default.html @@ -4,7 +4,7 @@ jQuery UI Effects - addClass demo - + - + diff --git a/tests/visual/button/button_disabled_true.html b/tests/visual/button/button_disabled_true.html index 5284dc022..ac21a5683 100644 --- a/tests/visual/button/button_disabled_true.html +++ b/tests/visual/button/button_disabled_true.html @@ -5,7 +5,7 @@ Button Visual Test : Button disabled true - + diff --git a/tests/visual/button/button_performance.html b/tests/visual/button/button_performance.html index 40d53d774..439e2c1ae 100644 --- a/tests/visual/button/button_performance.html +++ b/tests/visual/button/button_performance.html @@ -9,7 +9,7 @@ #toolbar { margin-top: 2em; padding:0.2em; } #ops1, #ops2, #format, #mode { margin-right: 1em } - + diff --git a/tests/visual/button/button_ticket_5254.html b/tests/visual/button/button_ticket_5254.html index ccd237f31..14d27698a 100644 --- a/tests/visual/button/button_ticket_5254.html +++ b/tests/visual/button/button_ticket_5254.html @@ -5,7 +5,7 @@ Button Visual Test : Button ticket #5254 - + diff --git a/tests/visual/button/button_ticket_5261.html b/tests/visual/button/button_ticket_5261.html index ad92c7aa9..0024393ee 100644 --- a/tests/visual/button/button_ticket_5261.html +++ b/tests/visual/button/button_ticket_5261.html @@ -5,7 +5,7 @@ Button Visual Test : Button ticket #5261 - + diff --git a/tests/visual/button/button_ticket_5278.html b/tests/visual/button/button_ticket_5278.html index ac2c1cff0..477a0b398 100644 --- a/tests/visual/button/button_ticket_5278.html +++ b/tests/visual/button/button_ticket_5278.html @@ -5,7 +5,7 @@ Button Visual Test : Button ticket #5278 - + diff --git a/tests/visual/compound/accordion_dialog.html b/tests/visual/compound/accordion_dialog.html index e11a35098..7b3b227ed 100644 --- a/tests/visual/compound/accordion_dialog.html +++ b/tests/visual/compound/accordion_dialog.html @@ -5,7 +5,7 @@ Compound Visual Test : Accordion in Dialog - + diff --git a/tests/visual/compound/accordion_tabs.html b/tests/visual/compound/accordion_tabs.html index f356179c9..e98edaf7c 100644 --- a/tests/visual/compound/accordion_tabs.html +++ b/tests/visual/compound/accordion_tabs.html @@ -5,7 +5,7 @@ Compound Visual Test : Accordion in Tabs - + diff --git a/tests/visual/compound/datepicker_dialog.html b/tests/visual/compound/datepicker_dialog.html index 1762e6108..0ef3f9bbc 100644 --- a/tests/visual/compound/datepicker_dialog.html +++ b/tests/visual/compound/datepicker_dialog.html @@ -5,7 +5,7 @@ Compound Visual Test : Datepicker in Dialog - + diff --git a/tests/visual/compound/draggable_accordion.html b/tests/visual/compound/draggable_accordion.html index 634ffbe2d..396d0e29c 100644 --- a/tests/visual/compound/draggable_accordion.html +++ b/tests/visual/compound/draggable_accordion.html @@ -5,7 +5,7 @@ Compound Visual Test : Draggable in Accordion - + diff --git a/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html b/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html index 3f211b046..a1199c826 100644 --- a/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html +++ b/tests/visual/compound/draggable_accordion_accordion_tabs_draggable.html @@ -5,7 +5,7 @@ Compound Visual Test : Draggable in Accordion - + diff --git a/tests/visual/compound/sortable_accordion_sortable_tabs.html b/tests/visual/compound/sortable_accordion_sortable_tabs.html index c055016b6..02a6c0dec 100644 --- a/tests/visual/compound/sortable_accordion_sortable_tabs.html +++ b/tests/visual/compound/sortable_accordion_sortable_tabs.html @@ -5,7 +5,7 @@ Compound Visual Test : Accordion in Tabs - + diff --git a/tests/visual/compound/tabs_tabs.html b/tests/visual/compound/tabs_tabs.html index 7398bef3a..12515a4c5 100644 --- a/tests/visual/compound/tabs_tabs.html +++ b/tests/visual/compound/tabs_tabs.html @@ -5,7 +5,7 @@ Compound Visual Test : Tabs in Tabs - + diff --git a/tests/visual/compound/tabs_tooltips.html b/tests/visual/compound/tabs_tooltips.html index d8d132a30..38b85e58b 100644 --- a/tests/visual/compound/tabs_tooltips.html +++ b/tests/visual/compound/tabs_tooltips.html @@ -5,7 +5,7 @@ Compound Visual Test : Tabs in Tabs - + diff --git a/tests/visual/compound/widgets_in_dialog.html b/tests/visual/compound/widgets_in_dialog.html index 999b67b0f..b711efa9c 100644 --- a/tests/visual/compound/widgets_in_dialog.html +++ b/tests/visual/compound/widgets_in_dialog.html @@ -5,7 +5,7 @@ Compound Visual Test : All Widgets in Dialog - + diff --git a/tests/visual/dialog/dialog_on_page_with_large_dom.html b/tests/visual/dialog/dialog_on_page_with_large_dom.html index 2a9307194..c7c105696 100644 --- a/tests/visual/dialog/dialog_on_page_with_large_dom.html +++ b/tests/visual/dialog/dialog_on_page_with_large_dom.html @@ -5,7 +5,7 @@ Dialog Visual Test : Modal Dialog in Large DOM - + diff --git a/tests/visual/effects/effects.all.html b/tests/visual/effects/effects.all.html index 838e17a3c..ddc665437 100644 --- a/tests/visual/effects/effects.all.html +++ b/tests/visual/effects/effects.all.html @@ -4,7 +4,7 @@ jQuery UI Effects Test Suite - + diff --git a/tests/visual/effects/effects.scale.html b/tests/visual/effects/effects.scale.html index 2d35cee18..845625e2e 100644 --- a/tests/visual/effects/effects.scale.html +++ b/tests/visual/effects/effects.scale.html @@ -4,7 +4,7 @@ jQuery UI Effects Test Suite - + diff --git a/tests/visual/menu/drilldown.html b/tests/visual/menu/drilldown.html index 838583e88..a2ae9e88f 100644 --- a/tests/visual/menu/drilldown.html +++ b/tests/visual/menu/drilldown.html @@ -4,7 +4,7 @@ Menu Visual Test: Default - + diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index 80062a423..50837f43e 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -4,7 +4,7 @@ Menu Visual Test: Default - + diff --git a/tests/visual/menu/tablemenu.html b/tests/visual/menu/tablemenu.html index be1d06460..bce64bfb5 100644 --- a/tests/visual/menu/tablemenu.html +++ b/tests/visual/menu/tablemenu.html @@ -4,7 +4,7 @@ Menu Visual Test: Default - + diff --git a/tests/visual/position/position.html b/tests/visual/position/position.html index e28a6ae69..9d29abe28 100644 --- a/tests/visual/position/position.html +++ b/tests/visual/position/position.html @@ -5,7 +5,7 @@ Position Visual Test: Default - + diff --git a/tests/visual/position/position_fit.html b/tests/visual/position/position_fit.html index 73a683dce..78751d3ef 100644 --- a/tests/visual/position/position_fit.html +++ b/tests/visual/position/position_fit.html @@ -5,7 +5,7 @@ Position Visual Test: Fit - + diff --git a/tests/visual/position/position_flip.html b/tests/visual/position/position_flip.html index 766576fde..7b26f6a9a 100644 --- a/tests/visual/position/position_flip.html +++ b/tests/visual/position/position_flip.html @@ -5,7 +5,7 @@ Position Visual Test: Flip - + diff --git a/tests/visual/position/position_flipfit.html b/tests/visual/position/position_flipfit.html index edb1adecf..b5cf82946 100644 --- a/tests/visual/position/position_flipfit.html +++ b/tests/visual/position/position_flipfit.html @@ -5,7 +5,7 @@ Position Visual Test: FlipFit - + diff --git a/tests/visual/position/position_margin.html b/tests/visual/position/position_margin.html index 1e6608d91..52b800837 100644 --- a/tests/visual/position/position_margin.html +++ b/tests/visual/position/position_margin.html @@ -5,7 +5,7 @@ Position Visual Test: Default - + diff --git a/tests/visual/position/position_within.html b/tests/visual/position/position_within.html index f348c5e8d..156c82e5d 100644 --- a/tests/visual/position/position_within.html +++ b/tests/visual/position/position_within.html @@ -7,7 +7,7 @@ - + diff --git a/tests/visual/theme.html b/tests/visual/theme.html index d10f2444f..131cc41d7 100644 --- a/tests/visual/theme.html +++ b/tests/visual/theme.html @@ -4,7 +4,7 @@ jQuery UI Example Page - + diff --git a/tests/visual/tooltip/animations.html b/tests/visual/tooltip/animations.html index b1ffc8914..993fbbd85 100644 --- a/tests/visual/tooltip/animations.html +++ b/tests/visual/tooltip/animations.html @@ -4,7 +4,7 @@ Tooltip Visual Test: Default - + diff --git a/tests/visual/tooltip/callout.html b/tests/visual/tooltip/callout.html index 3a498b2a6..79d8d32bf 100644 --- a/tests/visual/tooltip/callout.html +++ b/tests/visual/tooltip/callout.html @@ -4,7 +4,7 @@ Tooltip Visual Test: Default - + diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html index 5eb1ab0a7..b282a73b7 100644 --- a/tests/visual/tooltip/tooltip.html +++ b/tests/visual/tooltip/tooltip.html @@ -4,7 +4,7 @@ Tooltip Visual Test: Default - + -- cgit v1.2.3 From 2445e20a856192179590c0d08e5d73479df1e52d Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 23 Nov 2011 13:39:45 -0500 Subject: Autocomplete: Making sure we do not show search menu after a blur. Fixed #7423 - Tab out of autocomplete with remote source can leave menu showing. --- tests/unit/autocomplete/autocomplete_events.js | 19 +++++++++++++++++++ ui/jquery.ui.autocomplete.js | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/unit/autocomplete/autocomplete_events.js b/tests/unit/autocomplete/autocomplete_events.js index 286d902f1..d6a008ea2 100644 --- a/tests/unit/autocomplete/autocomplete_events.js +++ b/tests/unit/autocomplete/autocomplete_events.js @@ -157,6 +157,25 @@ asyncTest( "cancel select", function() { }, 50 ); }); +asyncTest( "blur during remote search", function() { + expect( 1 ); + var ac = $( "#autocomplete" ).autocomplete({ + delay: 0, + source: function( request, response ) { + ok( true, "trigger request" ); + ac.simulate( "blur" ); + setTimeout(function() { + response([ "result" ]); + start(); + }, 100 ); + }, + open: function() { + ok( false, "opened after a blur" ); + } + }); + ac.val( "ro" ).keydown(); +}); + /* TODO previous fix broke more than it fixed, disabling this for now - messed up regular menu select event test("blur without selection", function() { expect(1); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 9871b52d7..dbda2058e 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -184,6 +184,7 @@ $.widget( "ui.autocomplete", { } clearTimeout( self.searching ); + self.cancelSearch = true; // clicks on the menu (or a button to trigger a search) will cause a blur event self.closing = setTimeout(function() { self.close( event ); @@ -373,6 +374,7 @@ $.widget( "ui.autocomplete", { _search: function( value ) { this.pending++; this.element.addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; this.source( { term: value }, this.response ); }, @@ -382,7 +384,7 @@ $.widget( "ui.autocomplete", { content = this._normalize( content ); } this._trigger( "response", null, { content: content } ); - if ( !this.options.disabled && content && content.length ) { + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { this._suggest( content ); this._trigger( "open" ); } else { -- cgit v1.2.3 From 2b9b2f28ecd8b631fede6ca690bd551ddc72e254 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 23 Nov 2011 14:26:52 -0500 Subject: Autocomplete: Removed commented out test. --- tests/unit/autocomplete/autocomplete_events.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/unit/autocomplete/autocomplete_events.js b/tests/unit/autocomplete/autocomplete_events.js index d6a008ea2..7b51ec4c0 100644 --- a/tests/unit/autocomplete/autocomplete_events.js +++ b/tests/unit/autocomplete/autocomplete_events.js @@ -176,22 +176,4 @@ asyncTest( "blur during remote search", function() { ac.val( "ro" ).keydown(); }); -/* TODO previous fix broke more than it fixed, disabling this for now - messed up regular menu select event -test("blur without selection", function() { - expect(1); - var ac = $("#autocomplete").autocomplete({ - delay: 0, - source: data - }); - stop(); - ac.val("j").keydown(); - setTimeout(function() { - $( ".ui-menu-item" ).first().simulate("mouseover"); - ac.simulate("keydown", { keyCode: $.ui.keyCode.TAB }); - deepEqual( ac.val(), "j" ); - start(); - }, 50); -}); -*/ - }( jQuery ) ); -- cgit v1.2.3 From 74a3f2ce0897ce8bdcac2acc997e68e3e8603121 Mon Sep 17 00:00:00 2001 From: kborchers Date: Wed, 23 Nov 2011 22:37:55 -0600 Subject: Menu: Move mousedown handler into _bind and fix focusing of the Menu after click. Fixes focus issues with Selectmenu and Autocomplete. --- ui/jquery.ui.menu.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index bf36a77fe..4fe859f4e 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -40,16 +40,6 @@ $.widget( "ui.menu", { id: this.menuId, role: "menu" }) - // Prevent focus from sticking to links inside menu after clicking - // them (focus should always stay on UL during navigation). - // If the link is clicked, redirect focus to the menu. - // TODO move to _bind below - .bind( "mousedown.menu", function( event ) { - if ( $( event.target).is( "a" ) ) { - event.preventDefault(); - $( this ).focus( 1 ); - } - }) // need to catch all clicks on disabled menu // not possible through _bind .bind( "click.menu", $.proxy( function( event ) { @@ -58,6 +48,11 @@ $.widget( "ui.menu", { } }, this)); this._bind({ + // Prevent focus from sticking to links inside menu after clicking + // them (focus should always stay on UL during navigation). + "mousedown .ui-menu-item > a": function( event ) { + event.preventDefault(); + }, "click .ui-menu-item:has(a)": function( event ) { event.stopImmediatePropagation(); var target = $( event.currentTarget ); @@ -66,6 +61,8 @@ $.widget( "ui.menu", { this.focus( event, target ); } this.select( event ); + // Redirect focus to the menu. + this.element.focus(); }, "mouseover .ui-menu-item": function( event ) { event.stopImmediatePropagation(); -- cgit v1.2.3 From 769abbabc3b7b27f6131705b5ebd64fb3120b817 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 24 Nov 2011 11:27:35 +0100 Subject: Upgrade jQuery to 1.7.1. --- demos/selectmenu/custom_render.html | 34 +++++++++++++++---------------- demos/selectmenu/default.html | 10 ++++----- tests/visual/selectmenu/autocomplete.html | 10 ++++----- tests/visual/selectmenu/dialog.html | 12 +++++------ tests/visual/selectmenu/disabled.html | 10 ++++----- tests/visual/selectmenu/events.html | 14 ++++++------- tests/visual/selectmenu/methods.html | 12 +++++------ tests/visual/selectmenu/option.html | 8 ++++---- tests/visual/selectmenu/tabs.html | 8 ++++---- 9 files changed, 59 insertions(+), 59 deletions(-) diff --git a/demos/selectmenu/custom_render.html b/demos/selectmenu/custom_render.html index f993bab2a..7e69dc3e1 100644 --- a/demos/selectmenu/custom_render.html +++ b/demos/selectmenu/custom_render.html @@ -4,7 +4,7 @@ jQuery UI Selectmenu - Default functionality - + @@ -14,7 +14,7 @@ + @@ -15,14 +15,14 @@ - +
diff --git a/tests/visual/selectmenu/autocomplete.html b/tests/visual/selectmenu/autocomplete.html index ad7b80640..b9c161699 100644 --- a/tests/visual/selectmenu/autocomplete.html +++ b/tests/visual/selectmenu/autocomplete.html @@ -4,7 +4,7 @@ jQuery UI Selectmenu - Event functionality - + @@ -14,9 +14,9 @@ + @@ -14,9 +14,9 @@ @@ -28,11 +28,11 @@ - +
-
+

Some example content

Test Link

diff --git a/tests/visual/selectmenu/disabled.html b/tests/visual/selectmenu/disabled.html index 508cb7bf9..e2bc436ac 100644 --- a/tests/visual/selectmenu/disabled.html +++ b/tests/visual/selectmenu/disabled.html @@ -4,7 +4,7 @@ jQuery UI Selectmenu - Disable functionality - + @@ -21,9 +21,9 @@ dropdown: false }); withOverflow.selectmenu("widget").addClass("overflow"); - $('select#files').selectmenu(); + $('select#files').selectmenu(); var files2 = $('select#files2').selectmenu(); - + $("#disable_select").toggle( function() { files2.selectmenu("disable"); }, function() { @@ -43,7 +43,7 @@ }, function() { files2.find("optgroup:eq(0)").removeAttr("disabled"); files2.selectmenu("refresh"); - + }); }); @@ -56,7 +56,7 @@ - +
diff --git a/tests/visual/selectmenu/events.html b/tests/visual/selectmenu/events.html index 021dfcb48..e17434add 100644 --- a/tests/visual/selectmenu/events.html +++ b/tests/visual/selectmenu/events.html @@ -4,7 +4,7 @@ jQuery UI Selectmenu - Event functionality - + @@ -16,19 +16,19 @@ $(function() { var log = $("#log"); var index = 0; - $('select').selectmenu({ + $('select').selectmenu({ open: function(event, ui) { $("
").text( index++ + " Opened").prependTo(log); - }, + }, close: function(event, ui) { $("
").text( index++ + " Closed").prependTo(log); - }, + }, focus : function(event, ui) { $("
").text( index++ + " Focused: " + ui.item.label + " #" + ui.item.index ).prependTo(log); - }, + }, select: function(event, ui) { $("
").text( index++ + " Selected: " + ui.item.label + " #" + ui.item.index ).prependTo(log); - }, + }, change: function(event, ui) { $("
").text( index++ + " Changed to: " + ui.item.label + " #" + ui.item.index ).prependTo(log); } @@ -44,7 +44,7 @@ - +
diff --git a/tests/visual/selectmenu/methods.html b/tests/visual/selectmenu/methods.html index 1cb527444..5476dfff8 100644 --- a/tests/visual/selectmenu/methods.html +++ b/tests/visual/selectmenu/methods.html @@ -4,7 +4,7 @@ jQuery UI Selectmenu - Event functionality - + @@ -15,21 +15,21 @@ + @@ -15,11 +15,11 @@ + @@ -14,9 +14,9 @@ - +
-- cgit v1.2.3 From 53ea93327e9040b7472e8fd2af2abaea19058e4a Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Mon, 28 Nov 2011 01:22:41 +0100 Subject: Selectmenu: improved method unit tests --- tests/unit/selectmenu/selectmenu_methods.js | 135 ++++++++++++++++++++-------- 1 file changed, 99 insertions(+), 36 deletions(-) diff --git a/tests/unit/selectmenu/selectmenu_methods.js b/tests/unit/selectmenu/selectmenu_methods.js index 17d5488d6..263d27be2 100644 --- a/tests/unit/selectmenu/selectmenu_methods.js +++ b/tests/unit/selectmenu/selectmenu_methods.js @@ -10,8 +10,8 @@ test( "destroy", function() { }); -test( "open", function() { - expect( 2 ); +test( "open / close", function() { + expect( 4 ); var element = $("#speed").selectmenu(); var widget = element.selectmenu("widget"); @@ -21,52 +21,115 @@ test( "open", function() { element.selectmenu("open"); ok( menu.is( ":visible" ), "menu visible" ); equals( menu.find("ul").attr("aria-hidden"), "false", "menu aria-disabled" ); + + element.selectmenu("close"); + ok( menu.is( ":hidden" ), "menu hidden" ); + equals( menu.find("ul").attr("aria-hidden"), "true", "menu aria-disabled" ); }); -test( "close", function() { - expect( 2 ); - +test("enable / disable", function () { + expect(12); var element = $("#speed").selectmenu(); var widget = element.selectmenu("widget"); var button = widget.filter(".ui-selectmenu-button"); var menu = widget.filter(".ui-selectmenu-menu"); - element.selectmenu("open"); - element.selectmenu("close"); - ok( menu.is( ":hidden" ), "menu hidden" ); - equals( menu.find("ul").attr("aria-hidden"), "true", "menu aria-disabled" ); + element.selectmenu("disable") + ok( element.selectmenu("option", "disabled"), "disable: widget option" ); + equals( button.attr("aria-disabled"), "true", "disable: button wrapper ARIA" ); + equals( button.children("a").attr("aria-disabled"), "true", "disable: button ARIA" ); + equals( button.children("a").attr("tabindex"), -1, "disable: button tabindex" ); + equals( menu.attr("aria-disabled"), "true", "disable: menu wrapper ARIA" ); + equals( menu.children("ul").attr("aria-disabled"), "true", "disable: menu ARIA" ); + + element.selectmenu("enable") + ok( !element.selectmenu("option", "disabled"), "enable: widget option" ); + equals( button.attr("aria-disabled"), "false", "enable: button wrapper ARIA" ); + equals( button.children("a").attr("aria-disabled"), "false", "enable: button ARIA" ); + equals( button.children("a").attr("tabindex"), 0, "enable: button tabindex" ); + equals( menu.attr("aria-disabled"), "false", "enable: menu wrapper ARIA" ); + equals( menu.children("ul").attr("aria-disabled"), "false", "enable: menu ARIA" ); }); -$.each([ - { - type: "default", - selector: "#speed", - options: null - }, - { - type: "pop-up", - selector: "#number", - options: { - dropdown: false - } - }, - { - type: "optgroups", - selector: "#files", - options: null +test("refresh - structure", function () { + expect(3); + var element = $("#number").selectmenu(); + var widget = element.selectmenu("widget"); + var button = widget.filter(".ui-selectmenu-button"); + var menu = widget.filter(".ui-selectmenu-menu"); + + element.find("option").eq(2).remove(); + element.find("option").eq(3).remove(); + element.append(''); + element.find("option").first() + .attr("value", "changed_value") + .text("Changed value"); + element.selectmenu("refresh"); + + equals( element.find("option").length, menu.find("li").not(".ui-selectmenu-optgroup").length, "menu item length" ); + equals( element.find("option").last().text(), menu.find("li").not(".ui-selectmenu-optgroup").last().text(), "added item" ); + equals( element.find("option").first().text(), menu.find("li").not(".ui-selectmenu-optgroup").first().text(), "chnaged item" ); +}); + + +test("refresh - disabled select", function () { + expect(6); + var element = $("#speed").selectmenu(); + var widget = element.selectmenu("widget"); + var button = widget.filter(".ui-selectmenu-button"); + var menu = widget.filter(".ui-selectmenu-menu"); + + element.attr("disabled", "disabled"); + element.selectmenu("refresh"); + + ok( element.selectmenu("option", "disabled"), "widget option" ); + equals( button.attr("aria-disabled"), "true", "button wrapper ARIA" ); + equals( button.children("a").attr("aria-disabled"), "true", "button ARIA" ); + equals( button.children("a").attr("tabindex"), -1, "button tabindex" ); + equals( menu.attr("aria-disabled"), "true", "menu wrapper ARIA" ); + equals( menu.children("ul").attr("aria-disabled"), "true", "mene ARIA" ); +}); + +test("refresh - disabled option", function () { + expect(2); + var element = $("#speed").selectmenu(); + var widget = element.selectmenu("widget"); + var button = widget.filter(".ui-selectmenu-button"); + var menu = widget.filter(".ui-selectmenu-menu"); + + element.attr("disabled", "disabled"); + element.find("option").eq(2).attr("disabled", "disabled"); + element.selectmenu("refresh"); + + var disabledItem = menu.find("li").not(".ui-selectmenu-optgroup").eq(2); + ok( disabledItem.hasClass("ui-state-disabled"), "class" ); + ok( disabledItem.children("a").length <= 0, "has no link" ); +}); + +test("refresh - disabled optgroup", function () { + var element = $("#files").selectmenu(); + var widget = element.selectmenu("widget"); + var button = widget.filter(".ui-selectmenu-button"); + var menu = widget.filter(".ui-selectmenu-menu"); + + var originalDisabledOptgroup = element.find("optgroup").first(); + var originalDisabledOptions = originalDisabledOptgroup.find("option"); + expect(2 + originalDisabledOptions.length * 2); + + originalDisabledOptgroup.attr("disabled", "disabled"); + element.selectmenu("refresh"); + + var item = menu.find("li.ui-selectmenu-optgroup").first(); + ok( item.hasClass("ui-state-disabled"), "class" ); + + equals( menu.find("li").not(".ui-selectmenu-optgroup").filter(".ui-state-disabled").length, originalDisabledOptions.length, "disabled options" ); + for ( var i = 0; i < originalDisabledOptions.length; i++ ) { + item = item.next("li"); + ok( item.hasClass("ui-state-disabled"), "item #" + i + ": class" ); + ok( item.children("a").length <= 0, "item #" + i + ": has no link" ); } -], function( i, settings ) { - test("refresh - " + settings.type, function () { - // expect(6); - var element = $(settings.selector).selectmenu(settings.options); - var widget = element.selectmenu("widget"); - var button = widget.filter(".ui-selectmenu-button"); - var menu = widget.filter(".ui-selectmenu-menu"); - - element.selectmenu("refresh"); - }); }); -- cgit v1.2.3