Commit a65536ad authored by alexpott's avatar alexpott

Revert "Issue #1971108 by Wim Leers, jessebeach, nod_: Convert contextual.js...

Revert "Issue #1971108 by Wim Leers, jessebeach, nod_: Convert contextual.js to use Backbone (and support dynamic contextual links)."

This reverts commit aad2d4a6 since the canges to edit.module were unintended.
parent 9ae545f7
/**
* @file
* Generic base styles for contextual module.
......@@ -6,13 +7,33 @@
.contextual-region {
position: relative;
}
.contextual .trigger:focus {
/* Override the .element-focusable position: static */
position: relative !important;
.touch .contextual .trigger {
display: block;
}
.contextual-links {
.contextual .contextual-links {
display: none;
}
.contextual.open .contextual-links {
.contextual-links-active .contextual-links {
display: block;
}
/**
* The .element-focusable class extends the .element-invisible class to allow
* the element to be focusable when navigated to via the keyboard.
*
* Add support for hover.
*/
.touch .contextual-region .element-invisible.element-focusable,
.contextual-region:hover .element-invisible.element-focusable {
clip: auto;
overflow: visible;
height: auto;
}
/* Override the position for contextual links. */
.contextual-region .element-invisible.element-focusable:active,
.contextual-region .element-invisible.element-focusable:focus,
.contextual-region:hover .element-invisible.element-focusable,
.contextual-region-active .element-invisible.element-focusable,
.touch .contextual-region .element-invisible.element-focusable {
position: relative !important;
}
This diff is collapsed.
......@@ -91,9 +91,6 @@ function contextual_library_info() {
'dependencies' => array(
array('system', 'jquery'),
array('system', 'drupal'),
array('system', 'drupalSettings'),
array('system', 'backbone'),
array('system', 'modernizr'),
array('system', 'jquery.once'),
),
);
......@@ -110,9 +107,8 @@ function contextual_library_info() {
),
'dependencies' => array(
array('system', 'jquery'),
array('system', 'drupal'),
array('system', 'backbone'),
array('system', 'jquery.once'),
array('system', 'backbone'),
array('system', 'drupal.tabbingmanager'),
array('system', 'drupal.announce'),
),
......
......@@ -16,17 +16,15 @@
*/
.contextual .trigger {
float: left;
right: auto;
right: 0;
left: 2px;
}
/**
* Contextual links.
*/
.contextual-region .contextual .contextual-links {
.contextual .contextual-links {
border-radius: 0 4px 4px 4px;
float: left;
left: 2px;
right: auto;
text-align: right;
}
......@@ -13,14 +13,6 @@
z-index: 500;
}
/**
* Contextual region.
*/
.contextual-region.focus {
outline: 1px dashed #d6d6d6;
outline-offset: 1px;
}
/**
* Contextual trigger.
*/
......@@ -42,16 +34,15 @@
padding: 0 2px;
position: relative;
right: 2px; /* LTR */
/* Override the .element-focusable height: auto */
width: 28px !important;
width: 28px;
text-indent: -9999px;
z-index: 2;
cursor: pointer;
}
.contextual.open .trigger {
.contextual-links-active .trigger {
border-bottom-color: transparent;
border-radius: 13px 13px 0 0;
box-shadow: none;
z-index: 2;
}
/**
......@@ -68,10 +59,10 @@
margin: 0;
padding: 0.25em 0;
position: relative;
right: 2px; /* LTR */
text-align: left; /* LTR */
top: -1px;
white-space: nowrap;
z-index: 1;
}
.contextual-region .contextual .contextual-links li {
background-color: #fff;
......
......@@ -14,49 +14,6 @@
use Drupal\Core\Entity\EntityInterface;
use Drupal\edit\Form\EditFieldForm;
use Drupal\Component\Utility\NestedArray;
use Drupal\field\Plugin\views\field\Field;
/**
* Implements hook_preprocess_views_view_fields().
*
* Still a lot of handwaving for marking up views fields as in-place editable.
*/
function edit_preprocess_views_view_field(&$variables) {
if (user_access('access in-place editing')) {
// Early-return if output is empty.
if (empty($variables['output'])) {
return;
}
$views_field = $variables['field'];
// If this Views Field is hidden from display, then don't alter its output.
if ($views_field->options['exclude']) {
return;
}
// Only annotate Field API View Fields
if ($views_field instanceof Field) {
// Entity/Field metadata.
$entity = $variables['row']->_entity;
$field_name = $views_field->field_info->id;
$langcode = $views_field->field_info->langcode;
// Views metadata.
$view_name = $variables['view']->storage->id;
$view_display = $variables['view']->current_display;
$view_row = $variables['view']->row_index;
// Build edit ID; the view mode is now a hybrid that contains the
// necessary metadata for Views.
$edit_id = $entity->entityType() . '/' . $entity->id() . '/' . $field_name . '/' . $langcode . "/views-$view_name-$view_display-$view_row";
// @todo Push the rendering of the data-edit-id attribute deeper into the
// Views rendering pipeline instead of wrapping content in <span> tags.
$variables['output'] = '<span data-edit-id="' . $edit_id . '">' . $variables['output'] . '</span>';
}
}
}
/**
* Implements hook_custom_theme().
......
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