summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorccjjmartin2019-01-05 03:33:15 (GMT)
committerEmil Stjerneman2019-01-05 03:33:15 (GMT)
commite6780a7cca952ca547111ae762dd3cb04ac98c91 (patch)
treeeab7a9d302c1a64b72b422f73e5899b55259891d
parent9751b222691007a30c886e9f14ddf3ec1da88f18 (diff)
Issue #2782339 by ccjjmartin: Linkit Button doesnt work with TinyMCE when in full screen7.x-3.x
-rw-r--r--css/linkit.css2
-rw-r--r--editors/tinymce/editor_plugin.js15
2 files changed, 13 insertions, 4 deletions
diff --git a/css/linkit.css b/css/linkit.css
index 08a8f52..482c769 100644
--- a/css/linkit.css
+++ b/css/linkit.css
@@ -224,5 +224,5 @@
}
.ui-dialog.ui-front.linkit-wrapper {
- z-index: 2000;
+ z-index: 210000;
}
diff --git a/editors/tinymce/editor_plugin.js b/editors/tinymce/editor_plugin.js
index 04a875a..098893d 100644
--- a/editors/tinymce/editor_plugin.js
+++ b/editors/tinymce/editor_plugin.js
@@ -18,11 +18,20 @@
// Set the editor object.
Drupal.settings.linkit.currentInstance.editor = editor;
+ // Get the instance id. Full screen mode is a completly separate
+ // instance of TinyMCE added to the page subsequently by the TinyMCE
+ // external library. As such this bypasses a lot of built in Drupal
+ // functionality from modules like WYSIWYG and distributions like
+ // Panopoly.
+ // @see https://www.drupal.org/node/1125582
+ var instanceId = editor.id == 'mce_fullscreen' ? editor.getParam('fullscreen_editor_id') : editor.id;
+
// Find the current input format of the field we're looking at. Note that we get it in the form
// "format<formatname" instead of just "<formatname>" so we use .substring() to remove the "format".
- if (Drupal.wysiwyg && Drupal.wysiwyg.instances[editor.id].format) {
- var format = Drupal.wysiwyg.instances[editor.id].format.substring(6);
- } else {
+ if (Drupal.wysiwyg && Drupal.wysiwyg.instances[instanceId] && Drupal.wysiwyg.instances[instanceId].format) {
+ var format = Drupal.wysiwyg.instances[instanceId].format.substring(6);
+ }
+ else {
alert(Drupal.t('Could not find the Linkit profile.'));
return;
}