From 537eb4092bcd5cbc412fec6eaad04332e32b2020 Mon Sep 17 00:00:00 2001 From: Son Nguyen Date: Wed, 27 May 2015 10:53:55 +1200 Subject: [PATCH] Remove classes .vertcentre .configure .blockinstane of div#configureblock when enter fullscreen mode. Bug 1455265 As the class has transformations, it affect the fullscreen function to get the correct position, width, and height values. Change-Id: I3dbd590da8b1c992a296704a7c67b9f6394efad3 --- htdocs/lib/web.php | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/htdocs/lib/web.php b/htdocs/lib/web.php index 853dcc2845..9a7fc9fb5e 100644 --- a/htdocs/lib/web.php +++ b/htdocs/lib/web.php @@ -211,6 +211,17 @@ tinyMCE.init({ ed.on('LoadContent', function(e) { // Hide all the 2nd/3rd row menu buttons jQuery('.mce-toolbar.mce-first').siblings().toggleClass('hidden'); + // The tinymce fullscreen mode does not work properly in a transformed container div + // such as div.vertcentre + // and IE doesn't like a preset z-index + // This work-around will remove/add classes: .vertcenter .configure .blockinstane + // of the configure block div + // when toggling fullscreen + jQuery('div[aria-label="Fullscreen"]').on('click', function(e) { + jQuery('div#configureblock').toggleClass('vertcentre'); + jQuery('div#configureblock').toggleClass('blockinstance'); + jQuery('div#configureblock').toggleClass('configure'); + }); }); {$extrasetup} } @@ -232,20 +243,6 @@ function imageBrowserConfigError(form, data) { } } -function updateBlockConfigWidth(configblock, width) { - var vpdim = getViewportDimensions(); - var w = Math.max(width, 500); - var style = { - 'position': 'absolute', - 'z-index': 1 - }; - var lborder = parseFloat(getStyle(configblock, 'border-left-width')); - var lpadding = parseFloat(getStyle(configblock, 'padding-left')); - style.left = ((vpdim.w - w) / 2 - lborder - lpadding) + 'px'; - style.width = w + 'px'; - setStyle(configblock, style); -} - function custom_urlconvert (u, n, e) { // Don't convert the url on the skype status buttons. if (u.indexOf('skype:') == 0) { -- GitLab