Commit e36c84de authored by webchick's avatar webchick

Issue #2568099 by Wim Leers, mdrummond, mortendk: Follow-up for #2407739:...

Issue #2568099 by Wim Leers, mdrummond, mortendk: Follow-up for #2407739: Remove the js-quickedit-main-content class that was added in favor of relying on <main>
parent 8971a864
......@@ -105,7 +105,7 @@ protected function verifyHelp($response = 200) {
$this->assertResponse($response);
if ($response == 200) {
$this->assertTitle($name . ' | Drupal', format_string('%module title was displayed', array('%module' => $module)));
$this->assertRaw('<h1 class="page-title">' . t($name) . '</h1>', format_string('%module heading was displayed', array('%module' => $module)));
$this->assertEqual($this->cssSelect('h1.page-title')[0], t($name), format_string('%module heading was displayed', array('%module' => $module)));
$admin_tasks = system_get_module_admin_tasks($module, system_get_info('module', $module));
if (!empty($admin_tasks)) {
$this->assertText(t('@module administration pages', array('@module' => $name)));
......
......@@ -369,10 +369,11 @@
var entityElement = $(fieldElement).closest(entityElementSelector);
// In the case of a full entity view page, the entity title is rendered
// outside of "the entity DOM node": it's rendered as the page title. So in
// this case, we find the main element of the page and use it as a full
// entity ancestor.
// this case, we find the lowest common parent element (deepest in the tree)
// and consider that the entity element.
if (entityElement.length === 0) {
entityElement = $('.js-quickedit-main-content').find(entityElementSelector);
var $lowestCommonParent = $(entityElementSelector).parents().has(fieldElement).first();
entityElement = $lowestCommonParent.find(entityElementSelector);
}
var entityInstanceID = entityElement
.get(0)
......
......@@ -113,6 +113,13 @@ function quickedit_field_formatter_info_alter(&$info) {
}
}
/**
* Implements hook_preprocess_HOOK() for the page title template.
*/
function quickedit_preprocess_page_title(&$variables) {
$variables['title_attributes']['class'][] = 'js-quickedit-page-title';
}
/**
* Implements hook_preprocess_HOOK() for field templates.
*/
......
......@@ -65,7 +65,7 @@
{{ page.help }}
<main role="main" class="js-quickedit-main-content">
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
......
......@@ -82,7 +82,7 @@
<div id="main-wrapper" class="layout-main-wrapper layout-container clearfix">
<div id="main" class="layout-main clearfix">
{{ page.breadcrumb }}
<main id="content" class="column main-content js-quickedit-main-content" role="main">
<main id="content" class="column main-content" role="main">
<section class="section">
<a id="main-content" tabindex="-1"></a>
{{ page.content }}
......
......@@ -63,7 +63,7 @@
{{ page.help }}
<main role="main" class="js-quickedit-main-content">
<main role="main">
<a id="main-content" tabindex="-1"></a>{# link is in html.html.twig #}
<div class="layout-content">
......
......@@ -54,7 +54,7 @@
<div class="layout-container">
{{ page.pre_content }}
{{ page.breadcrumb }}
<main class="page-content clearfix js-quickedit-main-content" role="main">
<main class="page-content clearfix" role="main">
<div class="visually-hidden"><a id="main-content" tabindex="-1"></a></div>
{{ page.highlighted }}
{% if page.help %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment