From e263ebda99f3d414bae91a4a47e74a37ff93ba9c Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Fri, 27 Sep 2013 18:53:15 +0200 Subject: Dialog: Switch back to shuffling z-index, but only look at .ui-front siblings. Fixes #9166 - Dialog: moveToTop implementation resets flash/video/iframe/scroll Fixes #9364 - Dialog: Click of element with tooltip scrolls the dialog to the top --- tests/visual/dialog/stacking.html | 62 +++++++++++++++++++++++++++++++++++++++ tests/visual/index.html | 4 +++ 2 files changed, 66 insertions(+) create mode 100644 tests/visual/dialog/stacking.html (limited to 'tests/visual') diff --git a/tests/visual/dialog/stacking.html b/tests/visual/dialog/stacking.html new file mode 100644 index 000000000..dcb7de280 --- /dev/null +++ b/tests/visual/dialog/stacking.html @@ -0,0 +1,62 @@ + + + + + Dialog Visual Test + + + + + + + + + + + + + + + + +

WHAT: Two dialogs, one embedding an iframe, one having just scrollable content.

+

EXPECTED: When focusing on one or the other dialog, it shouldn't affect how the content is displayed on the other dialog. It shouldn't reload the iframe or reset the scroll.

+ + +
+ +
+ +
+

a bunch of content

+
+ +
Just another dialog to test stacking
+ + + diff --git a/tests/visual/index.html b/tests/visual/index.html index 730eb4553..bb46137f4 100644 --- a/tests/visual/index.html +++ b/tests/visual/index.html @@ -33,7 +33,11 @@

Dialog

Effects

-- cgit v1.2.3 From fba5c6f94ae758452174c71db7ab107796b59486 Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Sun, 22 Sep 2013 21:03:46 -0500 Subject: Menu tests: Remove anchors from visual test --- tests/visual/menu/menu.html | 312 ++++++++++++++++++++------------------------ 1 file changed, 144 insertions(+), 168 deletions(-) (limited to 'tests/visual') diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index 3d4e81e92..f25163d5f 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -44,171 +44,161 @@

Default inline menu

Inline with disabled items and submenus

Menu with icons

Long menu with scroll overflow, to test menu's scroll-on-keypress behaviour

Menu with custom markup

@@ -216,93 +206,79 @@

Menu with custom markup, multi-line items and a custom submenu icon

Inline with dividers and elements without anchors

-- cgit v1.2.3 From 31e705ab324ec830062eee173a112551f7c919ea Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Tue, 24 Sep 2013 23:46:59 -0500 Subject: Menu: Add items option for better definition of menu items in non parent-child structures --- tests/unit/menu/menu.html | 43 ++++++++++++++++++++++++++++++++++++++++++ tests/unit/menu/menu_common.js | 1 + tests/unit/menu/menu_events.js | 31 ++++++++++++++++++++++++++++++ tests/visual/menu/menu.html | 9 +++++++-- ui/jquery.ui.menu.js | 25 +++++++++++++----------- 5 files changed, 96 insertions(+), 13 deletions(-) (limited to 'tests/visual') diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html index 7de175b3c..a49c72a04 100644 --- a/tests/unit/menu/menu.html +++ b/tests/unit/menu/menu.html @@ -255,6 +255,49 @@
  • Saarland
  • + +
    diff --git a/tests/unit/menu/menu_common.js b/tests/unit/menu/menu_common.js index 4a89a947a..2404ebe02 100644 --- a/tests/unit/menu/menu_common.js +++ b/tests/unit/menu/menu_common.js @@ -4,6 +4,7 @@ TestHelpers.commonWidgetTests( "menu", { icons: { submenu: "ui-icon-carat-1-e" }, + items: "> *", menus: "ul", position: { my: "left top", diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 12bd5b703..0b89b86ac 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -577,6 +577,37 @@ asyncTest( "handle keyboard navigation and mouse click on menu with disabled ite } }); +asyncTest( "handle keyboard navigation and mouse click on menu with dividers and group labels", function() { + expect( 2 ); + var element = $( "#menu7" ).menu({ + items: "> :not('.ui-menu-group')", + select: function( event, ui ) { + log( $( ui.item[0] ).text() ); + }, + focus: function( event ) { + log( $( event.target ).find( ".ui-state-focus" ).index()); + } + }); + + log( "keydown", true ); + element.one( "menufocus", function() { + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ); + equal( logOutput(), "keydown,2,Ada", "Keydown skips initial group label" ); + setTimeout( menukeyboard1, 50 ); + }); + element.focus(); + + function menukeyboard1() { + log( "keydown", true ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + equal( logOutput(), "keydown,3,4,7", "Keydown focus skips divider and group label" ); + start(); + } +}); + asyncTest( "handle keyboard navigation with spelling of menu items", function() { expect( 2 ); var element = $( "#menu2" ).menu({ diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index f25163d5f..1c203ef12 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -15,7 +15,7 @@ $( "

    " ).text( "Selected: " + ui.item.text() ).appendTo( "#log" ); } - $( "#menu1, #menu2, #menu3, .menu4, #menu7" ).menu({ + $( "#menu1, #menu2, #menu3, .menu4" ).menu({ select: logger }); @@ -29,6 +29,11 @@ select: logger, icon: "ui-icon-carat-1-s" }); + + $( "#menu7" ).menu({ + items: "> :not('.ui-menu-group')", + select: logger + }); });