diff --git a/core/misc/dropbutton/dropbutton.css b/core/misc/dropbutton/dropbutton.css index 69e55bb..4f5ac5b 100644 --- a/core/misc/dropbutton/dropbutton.css +++ b/core/misc/dropbutton/dropbutton.css @@ -12,9 +12,9 @@ box-sizing: border-box; } .js .dropbutton { - position: relative; + position: relative; display: block; - float: left; + float: left; } @media screen and (max-width:600px) { @@ -36,7 +36,7 @@ position: static; } .js td .dropbutton { - min-height: 2em; + min-height: 2em; } .js td .dropbutton--multiple { max-width: 100%; @@ -47,25 +47,25 @@ /* UL styles are over-scoped in core, so this selector needs weight parity. */ .js .dropbutton .dropbutton__menu { - /* Positioning declarations */ - position: absolute; - top: 2em; - /* Box model declarations */ - display: none; - margin: 5px 0; - min-width: 100%; - padding: 5px 0; - /* Other declarations */ - background: #fff; - border: 1px solid #a6a6a6; - border-radius: 5px; - list-style-image: none; + /* Positioning declarations */ + position: absolute; + top: 2em; + /* Box model declarations */ + display: none; + margin: 5px 0; + min-width: 100%; + padding: 5px 0; + /* Other declarations */ + background: #fff; + border: 1px solid #a6a6a6; + border-radius: 5px; + list-style-image: none; list-style-type: none; - overflow: hidden; + overflow: hidden; } .dropbutton--multiple.is-open .dropbutton__menu { - display: block; + display: block; } .js .dropbutton__menu li, @@ -100,14 +100,12 @@ } .dropbutton--multiple.is-open { max-width: none; -} -.dropbutton--multiple.is-open { z-index: 100; } .dropbutton--multiple .dropbutton__menu .dropbutton__action { - padding: 0.35em 1em; - color: #262626; - text-decoration: none; + padding: 0.35em 1em; + color: #262626; + text-decoration: none; } .dropbutton--multiple .dropbutton__menu .dropbutton__action:focus, @@ -116,20 +114,20 @@ } .dropbutton__trigger { - /* Positioning declarations */ + /* Positioning declarations */ bottom: 0; - right: 0; /* LTR */ - top: 0; - /* Box model declarations */ - display: block; - height: auto; - margin: 0; - padding: 0; - width: 2em; - /* Other declarations */ - cursor: pointer; - text-indent: 110%; - white-space: nowrap; + right: 0; /* LTR */ + top: 0; + /* Box model declarations */ + display: block; + height: auto; + margin: 0; + padding: 0; + width: 2em; + /* Other declarations */ + cursor: pointer; + text-indent: 110%; + white-space: nowrap; } [dir="rtl"] .dropbutton__trigger { left: 0; @@ -140,18 +138,18 @@ outline: initial; } .dropbutton__trigger:after { - /* Positioning declarations */ - position: absolute; + /* Positioning declarations */ + position: absolute; right: 40%; /* 0.6667em; */ /* LTR */ top: 50%; - /* Box model declarations */ - content: ""; + /* Box model declarations */ + content: ""; display: block; - height: 0; + height: 0; line-height: 0; - margin-top: -0.1666em; + margin-top: -0.1666em; width: 0; - /* Other declarations */ + /* Other declarations */ border-bottom-color: transparent; border-left-color: transparent; border-right-color: transparent; @@ -165,28 +163,28 @@ } .dropbutton--multiple.is-open .dropbutton__trigger:after { top: 0.6667em; - border-bottom: 0.3333em solid; + border-bottom: 0.3333em solid; border-top-color: transparent; } -.dropbutton .button.dropbutton__action { - /* Box model declarations */ - padding-left: 1em; - float: left; - /* Other declarations */ - border-radius: 0; - border-top-left-radius: 20em; +.dropbutton--multiple .button.dropbutton__action { + /* Box model declarations */ + padding-left: 1em; + float: left; + /* Other declarations */ + border-radius: 0; + border-top-left-radius: 20em; border-bottom-left-radius: 20em; - font-size: 0.825rem; + font-size: 0.825rem; } .dropbutton .button.dropbutton__trigger { - /* Positioning declarations */ - position: absolute; - /* Box model declarations */ + /* Positioning declarations */ + position: absolute; + /* Box model declarations */ padding-right: 1em; - float: left; - margin-left: -1px; - /* Other declarations */ + float: left; + margin-left: -1px; + /* Other declarations */ border-radius: 0; - border-top-right-radius: 20em; + border-top-right-radius: 20em; border-bottom-right-radius: 20em; } diff --git a/core/misc/dropbutton/dropbutton.js b/core/misc/dropbutton/dropbutton.js index 9e09f17..a8d4077 100644 --- a/core/misc/dropbutton/dropbutton.js +++ b/core/misc/dropbutton/dropbutton.js @@ -78,19 +78,18 @@ * * @type {jQuery} */ - this.$actions = this.$list.find('li').addClass('dropbutton__action'); - + this.$actions = this.$list.find('li'); // Add the special dropdown only if there are hidden actions. if (this.$actions.length > 1) { // Identify the first element of the collection. var $primary = this.$actions.slice(0, 1).find('a'); - // Remove parent
  • for first dropbutton action and move. - $primary.unwrap().addClass('button').each(function() { - $(this).parent().before(this); - }); + // Remove parent
  • for first dropbutton action and move. + $primary.unwrap().addClass('button dropbutton__action').each(function() { + $(this).parent().before(this); + }); // Identify the secondary actions. - var $secondary = this.$actions.slice(1); - //$secondary.addClass('dropbutton__action'); + var $secondary = this.$actions.slice(1).find('a'); + $secondary.addClass('dropbutton__action'); // Add toggle link. $primary.after(Drupal.theme('dropbuttonToggle', options)); // Bind mouse events. @@ -126,8 +125,10 @@ }); } else { - //TODO route through button theming + //TODO route through button theming this.$dropbutton.addClass('dropbutton--single'); + var $action = this.$actions.slice(0, 1).find('a'); + $action.unwrap().unwrap().addClass('button dropbutton__action'); } } diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index bfd3ae3..d786024 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -692,7 +692,7 @@ public function testAdminBookNodeListing() { $this->drupalGet('admin/structure/book/' . $this->book->id()); $this->assertText($this->book->label(), 'The book title is displayed on the administrative book listing page.'); - $elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a'); + $elements = $this->xpath('//table//div[@class="dropbutton"]//a'); $this->assertEqual((string) $elements[0], 'View', 'View link is found from the list.'); } diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php index 5faa85c..a41c06e 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php @@ -200,7 +200,7 @@ protected function doTestTranslationOverview() { $elements = $this->xpath('//table//a[@href=:href]', array(':href' => $view_path)); $this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', array('%language' => $langcode))); $edit_path = $entity->url('edit-form', array('language' => $language)); - $elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a[@href=:href]', array(':href' => $edit_path)); + $elements = $this->xpath('//table//div[@class="dropbutton"]//a[@href=:href]', array(':href' => $edit_path)); $this->assertEqual((string) $elements[0], t('Edit'), format_string('Edit link correct for %language translation.', array('%language' => $langcode))); } } diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 8bd8688..2791b63 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -150,7 +150,7 @@ function manageFieldsPage($type = '') { // Assert entity operations for all fields. $number_of_links = 3; $number_of_links_found = 0; - $operation_links = $this->xpath('//ul[@class = "dropbutton"]/li/a'); + $operation_links = $this->xpath('//div[@class = "dropbutton"]//a'); $url = base_path() . "admin/structure/types/manage/$type/fields/node.$type.body"; foreach ($operation_links as $link) { diff --git a/core/modules/node/src/Tests/AssertButtonsTrait.php b/core/modules/node/src/Tests/AssertButtonsTrait.php index 96eb6c8..8742f94 100644 --- a/core/modules/node/src/Tests/AssertButtonsTrait.php +++ b/core/modules/node/src/Tests/AssertButtonsTrait.php @@ -35,7 +35,7 @@ public function assertButtons($buttons, $dropbutton = TRUE) { $this->assertTrue(empty($save_button)); // Dropbutton elements. - $elements = $this->xpath('//div[@class="dropbutton-wrapper"]//input[@type="submit"]'); + $elements = $this->xpath('//div[@class="dropbutton"]//input[@type="submit"]'); $this->assertEqual($count, count($elements)); foreach ($elements as $element) { $value = isset($element['value']) ? (string) $element['value'] : ''; @@ -46,7 +46,7 @@ public function assertButtons($buttons, $dropbutton = TRUE) { else { // Assert there is a save button. $this->assertTrue(!empty($save_button)); - $this->assertNoRaw('dropbutton-wrapper'); + $this->assertNoRaw('dropbutton'); } } } diff --git a/core/modules/views/src/Tests/Plugin/RowRenderCacheTest.php b/core/modules/views/src/Tests/Plugin/RowRenderCacheTest.php index d44e229..0666b1c 100644 --- a/core/modules/views/src/Tests/Plugin/RowRenderCacheTest.php +++ b/core/modules/views/src/Tests/Plugin/RowRenderCacheTest.php @@ -157,10 +157,10 @@ protected function doTestRenderedOutput(AccountInterface $account, $check_cache $output = $view->style_plugin->getField($index, 'delete_node'); $this->assertEqual($output, $expected); - $expected = $access ? "
      " . + $expected = $access ? "
    " : ""; + "
    " : ""; $output = $view->style_plugin->getField($index, 'operations'); $this->assertEqual($output, $expected); diff --git a/core/modules/views_ui/config/optional/tour.tour.views-ui.yml b/core/modules/views_ui/config/optional/tour.tour.views-ui.yml index 1b4e475..0b04d67 100644 --- a/core/modules/views_ui/config/optional/tour.tour.views-ui.yml +++ b/core/modules/views_ui/config/optional/tour.tour.views-ui.yml @@ -60,7 +60,7 @@ tips: body: 'Add, rearrange or remove filters.' weight: 7 attributes: - data-class: 'views-ui-display-tab-bucket.filter .dropbutton-widget' + data-class: 'views-ui-display-tab-bucket.filter .dropbutton' views-ui-sorts: id: views-ui-sorts plugin: text @@ -76,7 +76,7 @@ tips: body: 'Add, rearrange or remove sorting rules.' weight: 9 attributes: - data-class: 'views-ui-display-tab-bucket.sort .dropbutton-widget' + data-class: 'views-ui-display-tab-bucket.sort .dropbutton' views-ui-preview: id: views-ui-preview plugin: text diff --git a/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php index b11f54a..916fdff 100644 --- a/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -419,7 +419,7 @@ public function getDisplayDetails($view, $display) { // Because some of the 'links' are actually submit buttons, we have to // manually wrap each item in
  • and the whole list in