diff --git a/core/misc/dropbutton/dropbutton.base-rtl.css b/core/misc/dropbutton/dropbutton.base-rtl.css index be6fd6c..044272b 100644 --- a/core/misc/dropbutton/dropbutton.base-rtl.css +++ b/core/misc/dropbutton/dropbutton.base-rtl.css @@ -7,7 +7,7 @@ /** * The dropbutton arrow. */ -.dropbutton-link { +.dropbutton-toggle { left: 0; right: auto; } @@ -16,8 +16,6 @@ right: auto; } .dropbutton-multiple .dropbutton-widget { - left: auto; padding-left: 2em; padding-right: 0; - right: 0; } diff --git a/core/misc/dropbutton/dropbutton.base.css b/core/misc/dropbutton/dropbutton.base.css index 8c6448f..5a5f71c 100644 --- a/core/misc/dropbutton/dropbutton.base.css +++ b/core/misc/dropbutton/dropbutton.base.css @@ -13,28 +13,21 @@ -webkit-box-sizing: border-box; box-sizing: border-box; } -.dropbutton-wrapper, -.dropbutton-widget { - max-width: 100%; -} .dropbutton-wrapper { - min-height: 1em; - position: relative; + display: inline-block; } .dropbutton-widget { - display: block; - position: absolute; - right: 0; /* LTR */ + position: relative; } /* UL styles are over-scoped in core, so this selector needs weight parity. */ -.dropbutton-widget .dropbutton-content { +.dropbutton-widget .dropbutton { list-style-image: none; list-style-type: none; margin: 0; padding: 0; } -.dropbutton-content li, -.dropbutton-content a { +.dropbutton li, +.dropbutton a { display: block; } @@ -51,23 +44,15 @@ .dropbutton-multiple .dropbutton-widget { padding-right: 2em; /* LTR */ } -.dropbutton-multiple.open, -.dropbutton-multiple.open .dropbutton-widget { - max-width: none; -} -.dropbutton-multiple.open { - z-index: 100; -} -.dropbutton-multiple .dropbutton-content .secondary-actions { +.dropbutton-multiple .dropbutton .secondary-action { display: none; } -.dropbutton-multiple.open .dropbutton-content .secondary-actions { +.dropbutton-multiple.open .dropbutton .secondary-action { display: block; } -.dropbutton-link { +.dropbutton-toggle { bottom: 0; display: block; - overflow: hidden; position: absolute; right: 0; /* LTR */ text-indent: 110%; @@ -75,6 +60,16 @@ white-space: nowrap; width: 2em; } +.dropbutton-toggle button { + background: none; + border: 0; + cursor: pointer; + display: block; + height: 100%; + margin: 0; + padding: 0; + width: 100%; +} .dropbutton-arrow { border-bottom-color: transparent; border-left-color: transparent; @@ -85,12 +80,12 @@ height: 0; line-height: 0; position: absolute; - right: 0.6667em; /* LTR */ - top: 0.767em; + right: 40%; /* 0.6667em; */ /* LTR */ + top: 0.9em; width: 0; } .dropbutton-multiple.open .dropbutton-arrow { border-bottom: 0.3333em solid; border-top-color: transparent; - top: 0.333em; + top: 0.6667em; } diff --git a/core/misc/dropbutton/dropbutton.js b/core/misc/dropbutton/dropbutton.js index 6d75fae..daaa072 100644 --- a/core/misc/dropbutton/dropbutton.js +++ b/core/misc/dropbutton/dropbutton.js @@ -12,7 +12,7 @@ Drupal.behaviors.dropButton = { // Adds the delegated handler that will toggle dropdowns on click. var $body = $('body').once('dropbutton-click'); if ($body.length) { - $body.on('click', '.dropbutton-link', dropbuttonClickHandler); + $body.on('click', '.dropbutton-toggle', dropbuttonClickHandler); } // Initialize all buttons. for (var i = 0, il = $dropbuttons.length; i < il; i++) { @@ -23,7 +23,7 @@ Drupal.behaviors.dropButton = { }; /** - * Delegated callback for for opening and closing dropbutton secondary actions. + * Delegated callback for opening and closing dropbutton secondary actions. */ function dropbuttonClickHandler (e) { e.preventDefault(); @@ -46,26 +46,25 @@ function dropbuttonClickHandler (e) { */ function DropButton (dropbutton, settings) { // Merge defaults with settings. - var options = $.extend({'title': Drupal.t('More')}, settings); + var options = $.extend({'title': Drupal.t('List additional actions')}, settings); var $dropbutton = $(dropbutton); this.$dropbutton = $dropbutton; this.$list = $dropbutton.find('.dropbutton'); - this.$actions = this.$list.find('li'); - - // Move the classes from .dropbutton up to .dropbutton-wrapper - this.$dropbutton.addClass(this.$list[0].className); - this.$dropbutton.attr('id', this.$list[0].id); - this.$list.attr({id: '', 'class': 'dropbutton-content'}); + // Find actions and mark them. + this.$actions = this.$list.find('li').addClass('dropbutton-action'); // Add the special dropdown only if there are hidden actions. if (this.$actions.length > 1) { - // Remove the first element of the collection and create a new jQuery - // collection for the secondary actions. - $(this.$actions.splice(1)).addClass('secondary-actions'); + // Identify the first element of the collection. + var $primary = this.$actions.slice(0,1); + // Identify the secondary actions. + var $secondary = this.$actions.slice(1); + $($secondary).addClass('secondary-action'); // Add toggle link. - this.$list.before(Drupal.theme('dropbuttonToggle', options)); + $primary.after(Drupal.theme('dropbuttonToggle', options)); // Bind mouse events. - this.$dropbutton.addClass('dropbutton-multiple') + this.$dropbutton + .addClass('dropbutton-multiple') .on({ /** * Adds a timeout to close the dropdown on mouseleave. @@ -135,14 +134,14 @@ $.extend(Drupal.theme, { * A toggle is an interactive element often bound to a click handler. * * @param {Object} options - * - {String} title: (optional) The HTML anchor title attribute and text for the - * inner span element. + * - {String} title: (optional) The HTML anchor title attribute and + * text for the inner span element. * * @return {String} * A string representing a DOM fragment. */ dropbuttonToggle: function (options) { - return '' + options.title + ''; + return '
  • '; } }); diff --git a/core/misc/dropbutton/dropbutton.theme-rtl.css b/core/misc/dropbutton/dropbutton.theme-rtl.css index 9d6456c..3e0fd7f 100644 --- a/core/misc/dropbutton/dropbutton.theme-rtl.css +++ b/core/misc/dropbutton/dropbutton.theme-rtl.css @@ -4,11 +4,11 @@ * General RTL styles for dropbuttons. */ -.dropbutton-multiple .dropbutton-content { +.dropbutton-multiple .dropbutton { border-left: 1px solid #e8e8e8; border-right: 0 none; } -.dropbutton-multiple .dropbutton-content li > * { +.dropbutton-multiple .dropbutton li > * { margin-left: 0.25em; margin-right: 0; } diff --git a/core/misc/dropbutton/dropbutton.theme.css b/core/misc/dropbutton/dropbutton.theme.css index 9c54b73..041724b 100644 --- a/core/misc/dropbutton/dropbutton.theme.css +++ b/core/misc/dropbutton/dropbutton.theme.css @@ -6,7 +6,6 @@ .dropbutton-wrapper { cursor: pointer; - min-height: 2em; } .dropbutton-widget { background-color: white; @@ -15,17 +14,16 @@ .dropbutton-widget:hover { border-color: #b8b8b8; } -.dropbutton-content li > * { - overflow: hidden; - padding: 0.2em 0.5em; +.dropbutton .dropbutton-action > * { + padding: 0.1em 0.5em; white-space: nowrap; } -.dropbutton-content li + li { +.dropbutton .secondary-action { border-top: 1px solid #e8e8e8; } -.dropbutton-multiple .dropbutton-content { +.dropbutton-multiple .dropbutton { border-right: 1px solid #e8e8e8; /* LTR */ } -.dropbutton-multiple .dropbutton-content li > * { +.dropbutton-multiple .dropbutton .dropbutton-action > * { margin-right: 0.25em; /* LTR */ } diff --git a/core/modules/node/node.admin-rtl.css b/core/modules/node/node.admin-rtl.css new file mode 100644 index 0000000..d836f65 --- /dev/null +++ b/core/modules/node/node.admin-rtl.css @@ -0,0 +1,7 @@ +/** + * Operations dropbuttons + */ +.dropbutton-widget { + left: 0; + right: auto; +} diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css index 5777b1f..b2ccf4a 100644 --- a/core/modules/node/node.admin.css +++ b/core/modules/node/node.admin.css @@ -10,3 +10,27 @@ .revision-current { background: #ffc; } + +/** + * Operations dropbuttons + */ +.dropbutton-wrapper { + display: block; + min-height: 2em; + position: relative; +} +.dropbutton-widget { + position: absolute; + right: 0; /* LTR */ +} +.dropbutton-wrapper, +.dropbutton-widget { + max-width: 100%; +} +.dropbutton-multiple.open, +.dropbutton-multiple.open .dropbutton-widget { + max-width: none; +} +.dropbutton-multiple.open { + z-index: 100; +} diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc index b90a9e4..f77ec7d 100644 --- a/core/modules/node/node.admin.inc +++ b/core/modules/node/node.admin.inc @@ -412,6 +412,9 @@ function node_admin_nodes() { '#title' => t('Update options'), '#attributes' => array('class' => array('container-inline')), '#access' => $admin_access, + '#attached' => array ( + 'css' => array(drupal_get_path('module', 'node') . '/node.admin.css'), + ), ); $options = array(); foreach (module_invoke_all('node_operations') as $operation => $array) { diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index 2a896b3..7d09ddd 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -1015,3 +1015,6 @@ div.add-or-remove-shortcuts { .dropbutton-multiple.open .dropbutton-content li:first-child > * { text-overflow: clip; } +.dropbutton-arrow { + right: 35%; +}