core/modules/outside_in/outside_in.module | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/modules/outside_in/outside_in.module b/core/modules/outside_in/outside_in.module index c397ffe..665468a 100644 --- a/core/modules/outside_in/outside_in.module +++ b/core/modules/outside_in/outside_in.module @@ -100,7 +100,14 @@ function outside_in_entity_type_build(array &$entity_types) { * Implements hook_preprocess_HOOK() for block templates. */ function outside_in_preprocess_block(&$variables) { - // Only blocks that have an off_canvas form will have a "Quick Edit" link. + // Only blocks that have an off_canvas form will have a "Quick Edit" link. We + // could wait for the contextual links to be initialized on the client side, + // and then add the class and data- attribute below there (via JavaScript). + // But that means that it will be impossible to show Settings Tray's clickable + // regions immediately when the page loads. When latency is high, this will + // cause flicker. Therefore, for now, we choose to duplicate some logic to + // guarantee a smooth experience. + // This is an implementation detail that may change in the future. // @see \Drupal\outside_in\Access\BlockPluginHasOffCanvasFormAccessCheck if (\Drupal::service('plugin.manager.block')->createInstance($variables['plugin_id'])->hasFormClass('off_canvas')) { // Add class and attributes to all blocks to allow Javascript to target.