diff --git a/core/modules/book/book.libraries.yml b/core/modules/book/book.libraries.yml index 2382e7531eb..d2bd52d1f75 100644 --- a/core/modules/book/book.libraries.yml +++ b/core/modules/book/book.libraries.yml @@ -12,9 +12,3 @@ navigation: css: theme: css/book.theme.css: {} - -admin: - version: VERSION - css: - theme: - css/book.admin.css: {} diff --git a/core/modules/book/book.module b/core/modules/book/book.module index 5497a0ae571..54efba44563 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -150,19 +150,17 @@ function book_form_node_form_alter(&$form, FormStateInterface $form_state, $form if ($access) { $collapsed = !($node->isNew() && !empty($node->book['pid'])); $form = \Drupal::service('book.manager')->addFormElements($form, $form_state, $node, $account, $collapsed); - // Since the "Book" dropdown can't trigger a form submission when - // JavaScript is disabled, add a submit button to do that. book.admin.css hides - // this button when JavaScript is enabled. + // The "js-hide" class hides submit button when Javascript is enabled. $form['book']['pick-book'] = array( '#type' => 'submit', '#value' => t('Change book (update list of parents)'), '#submit' => array('book_pick_book_nojs_submit'), '#weight' => 20, - '#attached' => [ - 'library' => [ - 'book/admin', - ], - ], + '#attributes' => array( + 'class' => array( + 'js-hide', + ), + ), ); $form['#entity_builders'][] = 'book_node_builder'; } diff --git a/core/modules/book/css/book.admin.css b/core/modules/book/css/book.admin.css deleted file mode 100644 index 1059aadeef9..00000000000 --- a/core/modules/book/css/book.admin.css +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @file - * Administration styles for the Book module. - */ - -/** - * Book outline on book edit form. - */ -.js .book-outline-form .form-submit { - display: none; -} diff --git a/core/modules/book/css/book.theme.css b/core/modules/book/css/book.theme.css index cb35465e08d..8f1f7de4823 100644 --- a/core/modules/book/css/book.theme.css +++ b/core/modules/book/css/book.theme.css @@ -3,9 +3,6 @@ * Styling for the Book module. */ -/** - * Book navigation. - */ .book-navigation .menu { padding-bottom: 0; padding-top: 1em; @@ -15,29 +12,29 @@ overflow: auto; padding: 0.5em 0; } -.book-pager li { +.book-pager__item { display: inline-block; list-style-type: none; vertical-align: top; } -.book-pager .previous { +.book-pager__item--previous { text-align: left; /* LTR */ width: 45%; } -[dir="rtl"] .book-pager .previous { +[dir="rtl"] .book-pager__item--previous { float: right; text-align: right; } -.book-pager .up { +.book-pager__item--center { text-align: center; width: 8%; } -.book-pager .next { +.book-pager__item--next { float: right; /* LTR */ text-align: right; /* LTR */ width: 45%; } -[dir="rtl"] .book-pager .next { +[dir="rtl"] .book-pager__item--next { float: left; text-align: left; } diff --git a/core/themes/classy/templates/navigation/book-navigation.html.twig b/core/themes/classy/templates/navigation/book-navigation.html.twig index afc2d7069ef..862ba4145a9 100644 --- a/core/themes/classy/templates/navigation/book-navigation.html.twig +++ b/core/themes/classy/templates/navigation/book-navigation.html.twig @@ -35,17 +35,17 @@

{{ 'Book traversal links for'|t }} {{ book_title }}