Commit 1284585a authored by ROBERT PATRICK CAREY III's avatar ROBERT PATRICK CAREY III 🗿

Cleanup - Inspector

parent c5510bca
......@@ -325,6 +325,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
window.paragraphInspector = !window.paragraphInspector;
let elements = document.querySelectorAll('.paragraph');
if(window.paragraphInspector){
document.querySelector('.toggle-inspector')._tippy.setContent('Paragraph Inspector (enabled)');
elements.forEach(element => {
tippy('#' + element.id, {
content: 'Paragraph: ' + element.id.replace('paragraph--', ''),
......@@ -339,8 +340,11 @@ document.addEventListener("DOMContentLoaded", function(event) {
})
});
} else {
document.querySelector('.toggle-inspector')._tippy.setContent('Paragraph Inspector (disabled)');
elements.forEach(element => {
element._tippy.destroy();
if(element._tippy){
element._tippy.destroy();
}
});
}
}
......
......@@ -70,24 +70,24 @@ function user_preferences_node_links_alter(array &$links, NodeInterface $node, a
'title' => t('<i class="fal fa-universal-access">&nbsp;</i>'),
'url' => Url::fromUri('internal:#toggleA11y'),
'attributes' => [
'title' => t('Accessibility Tools'),
'data-tippy-content' => t('Accessibility Tools'),
'id' => 'toggle_a11y_tools',
'onclick' => 'jQuery("#accessibilityPanel").modal("toggle")',
'data-toggle' => 'tooltip',
'aria-label' => 'Accessibility tools',
'title' => t('Accessibility Tools'),
'data-tippy-content' => t('Accessibility Tools'),
'id' => 'toggle_a11y_tools',
'onclick' => 'jQuery("#accessibilityPanel").modal("toggle")',
'data-toggle' => 'tooltip',
'aria-label' => 'Accessibility tools',
]
];
$link['paragraphInspector'] = [
'title' => t('<i class="fal fa-bullseye-pointer">&nbsp;</i>'),
'url' => Url::fromUri('internal:#toggleInspector'),
'attributes' => [
'title' => t('Identify Target'),
'data-tippy-content' => t('Identify Target'),
'id' => 'toggle_inspector',
'class' => 'toggle-inspector',
'data-toggle' => 'tooltip',
'aria-label' => 'Identify Target',
'title' => t('Paragraph Inspector'),
'data-tippy-content' => t('Paragraph Inspector (disabled)'),
'id' => 'toggle_inspector',
'class' => 'toggle-inspector',
'data-toggle' => 'tooltip',
'aria-label' => 'Paragraph Inspector',
]
];
}
......
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