From c88f6ba1e92a09b54ebe481a4c1a3ad78419a278 Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 8 Mar 2014 00:40:03 +0000 Subject: [PATCH] Set minimum z-index for the TinyMCE modals and adjust the z-index in DFW, see #26952 git-svn-id: https://develop.svn.wordpress.org/trunk@27460 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/media.css | 4 +-- src/wp-includes/css/editor.css | 26 +++++----------- src/wp-includes/css/jquery-ui-dialog.css | 4 +-- .../js/tinymce/plugins/wordpress/plugin.js | 31 +++++++++++-------- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css index 4bd36d84f0..521f0a1820 100644 --- a/src/wp-admin/css/media.css +++ b/src/wp-admin/css/media.css @@ -241,7 +241,7 @@ top: 30px; bottom: 30px; left: 50%; - z-index: 160000; + z-index: 100105; } .find-box-head { @@ -357,7 +357,7 @@ bottom: 0; background: #000; opacity: 0.7; - z-index: 159900; + z-index: 100100; } ul#dismissed-updates { diff --git a/src/wp-includes/css/editor.css b/src/wp-includes/css/editor.css index 77e711ad12..26c38ccaa9 100644 --- a/src/wp-includes/css/editor.css +++ b/src/wp-includes/css/editor.css @@ -13,7 +13,6 @@ /* TinyMCE windows */ #mce-modal-block.mce-in { opacity: 0.7; - z-index: 159900 !important; /* Overwrite inline style added by TinyMCE. */ } .mce-window { @@ -21,7 +20,6 @@ border-radius: 0; -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7); box-shadow: 0 5px 15px rgba(0,0,0,0.7); - z-index: 160000 !important; /* Overwrite inline style added by TinyMCE. */ -webkit-font-smoothing: subpixel-antialiased; } @@ -837,7 +835,7 @@ i.mce-caret:before { padding: 2px; position: absolute; display: none; - z-index: 155000; + z-index: 100020; } #wp_editimgbtn, @@ -1474,7 +1472,7 @@ i.mce-caret:before { * =Overlay Styles -------------------------------------------------------------- */ .fullscreen-overlay { - z-index: 149999; + z-index: 100005; display: none; position: fixed; top: 0; @@ -1502,7 +1500,7 @@ i.mce-caret:before { -------------------------------------------------------------- */ #wp-fullscreen-body { - z-index: 150005; + z-index: 100010; display: none; } @@ -1514,7 +1512,7 @@ i.mce-caret:before { right: 0; bottom: 30px; top: 60px; - z-index: 150010; + z-index: 100015; } @@ -1580,7 +1578,7 @@ i.mce-caret:before { right: 0; top: 0; width: 100%; - z-index: 150050; + z-index: 100020; -webkit-transition: opacity 0.4s; transition: opacity 0.4s; } @@ -1719,21 +1717,11 @@ i.mce-caret:before { /* =Thickbox Adjustments -------------------------------------------------------------- */ .wp-fullscreen-active #TB_overlay { - z-index: 150100; + z-index: 100050; } .wp-fullscreen-active #TB_window { - z-index: 150102; -} - -/* =TinyMCE Adjustments --------------------------------------------------------------- */ -.wp-fullscreen-active #mce-modal-block { - z-index: 150100 !important; -} - -.wp-fullscreen-active .mce-window { - z-index: 150102 !important; + z-index: 100051; } /* Colors */ diff --git a/src/wp-includes/css/jquery-ui-dialog.css b/src/wp-includes/css/jquery-ui-dialog.css index c6dcdb7339..a8b8e7da20 100644 --- a/src/wp-includes/css/jquery-ui-dialog.css +++ b/src/wp-includes/css/jquery-ui-dialog.css @@ -252,7 +252,7 @@ /* WP jQuery Dialog Theme */ .wp-dialog { padding: 0; - z-index: 300002; + z-index: 100102; border: 0; -webkit-box-shadow: 0 5px 15px rgba(0,0,0,0.7); box-shadow: 0 5px 15px rgba(0,0,0,0.7); @@ -312,7 +312,7 @@ } .ui-widget-overlay { - z-index: 300001; + z-index: 100101; background-color: #000; opacity: 0.6; filter: alpha(opacity=60); diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index ab5d2e03f9..e838f7d429 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -1,4 +1,8 @@ -/* global tinymce, getUserSetting, setUserSetting, switchEditors */ +/* global tinymce, getUserSetting, setUserSetting */ + +// Set the minimum value for the modals z-index higher than #wpadminbar (100000) +tinymce.ui.FloatPanel.zIndex = 100100; + tinymce.PluginManager.add( 'wordpress', function( editor ) { var DOM = tinymce.DOM, wpAdvButton, modKey, style, last = 0; @@ -279,7 +283,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { var env = tinymce.Env, topx, reset, deltax = 0, bodyClass = ['mceContentBody'], // back-compat for themes that use this in editor-style.css... - doc = editor.getDoc(); + doc = editor.getDoc(), + dom = editor.dom; if ( editor.getParam( 'directionality' ) === 'rtl' ) { bodyClass.push('rtl'); @@ -299,7 +304,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { tinymce.each( bodyClass, function( cls ) { if ( cls ) { - editor.dom.addClass( doc.body, cls ); + dom.addClass( doc.body, cls ); } }); @@ -318,7 +323,7 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { if ( ! ( 'ontouchstart' in window ) ) { // When scrolling with mouse wheel or trackpad inside the editor, don't scroll the parent window - editor.dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) { + dom.bind( doc, 'onwheel' in doc ? 'wheel' : 'mousewheel', function( event ) { var delta, top, docElement = doc.documentElement; @@ -370,6 +375,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { event.preventDefault(); }); } + + dom.bind( doc, 'dragover', function( event ) { + if ( typeof window.jQuery !== 'undefined' ) { + // Propagate the event to its container for the parent window to catch. + window.jQuery( editor.getContainer() ).trigger( event ); + } + }); }); // Word count @@ -399,8 +411,8 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { // Keep empty paragraphs :( e.content = e.content.replace( /

(
|\u00a0|\uFEFF)?<\/p>/g, '

 

' ); - if ( editor.getParam( 'wpautop', true ) && typeof switchEditors !== 'undefined' ) { - e.content = switchEditors.pre_wpautop( e.content ); + if ( editor.getParam( 'wpautop', true ) && typeof window.switchEditors !== 'undefined' ) { + e.content = window.switchEditors.pre_wpautop( e.content ); } }); @@ -442,13 +454,6 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { editor.dom.bind( editor.getBody(), 'dragstart', function() { _hideButtons(); }); - - editor.dom.bind( editor.getWin(), 'dragover', function(e) { - if ( typeof window.jQuery !== 'undefined' ) { - // Propagate the event to its container for the parent window to catch. - jQuery( editor.getContainer() ).trigger(e); - } - }); }); editor.on( 'BeforeExecCommand', function() {