Customizer: improve setting the TinyMCE modals z-index.

Props westonruter, greuben.
See #41158.
Built from https://develop.svn.wordpress.org/trunk@40995


git-svn-id: http://core.svn.wordpress.org/trunk@40845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2017-07-03 21:18:44 +00:00
parent dc35b759be
commit dcc372e098
5 changed files with 10 additions and 6 deletions

View File

@ -5507,6 +5507,13 @@
} );
} ());
// Make sure TinyMCE dialogs appear above Customizer UI.
$( document ).one( 'wp-before-tinymce-init', function() {
if ( ! window.tinymce.ui.FloatPanel.zIndex || window.tinymce.ui.FloatPanel.zIndex < 500001 ) {
window.tinymce.ui.FloatPanel.zIndex = 500001;
}
} );
api.trigger( 'ready' );
});

File diff suppressed because one or more lines are too long

View File

@ -130,9 +130,6 @@ wp.textWidgets = ( function( $ ) {
wp.editor.remove( id );
}
// Adjust z-index for the customizer.
window.tinymce.ui.FloatPanel.zIndex = 500001;
wp.editor.initialize( id, {
tinymce: {
wpautop: true

View File

@ -1 +1 @@
wp.textWidgets=function(a){"use strict";var b={};return b.TextWidgetControl=Backbone.View.extend({events:{},initialize:function(b){var c=this;if(!b.el)throw new Error("Missing options.el");if(!b.syncContainer)throw new Error("Missing options.syncContainer");Backbone.View.prototype.initialize.call(c,b),c.syncContainer=b.syncContainer,c.$el.addClass("text-widget-fields"),c.$el.html(wp.template("widget-text-control-fields")),c.fields={title:c.$el.find(".title"),text:c.$el.find(".text")},_.each(c.fields,function(b,d){b.on("input change",function(){var b=c.syncContainer.find("input[type=hidden]."+d);b.val()!==a(this).val()&&(b.val(a(this).val()),b.trigger("change"))}),b.val(c.syncContainer.find("input[type=hidden]."+d).val())})},updateFields:function(){var a,b=this;b.fields.title.is(document.activeElement)||(a=b.syncContainer.find("input[type=hidden].title"),b.fields.title.val(a.val())),a=b.syncContainer.find("input[type=hidden].text"),b.fields.text.is(":visible")?b.fields.text.is(document.activeElement)||b.fields.text.val(a.val()):b.editor&&!b.editorFocused&&a.val()!==b.fields.text.val()&&b.editor.setContent(wp.editor.autop(a.val()))},initializeEditor:function(){function b(){var h,i,j;if(document.getElementById(c)){if("undefined"==typeof window.tinymce)return void wp.editor.initialize(c,{quicktags:!0});if(tinymce.get(c)&&(g=tinymce.get(c).isHidden(),wp.editor.remove(c)),window.tinymce.ui.FloatPanel.zIndex=500001,wp.editor.initialize(c,{tinymce:{wpautop:!0},quicktags:!0}),h=window.tinymce.get(c),!h)throw new Error("Failed to initialize editor");j=function(){a(h.getWin()).on("unload",function(){_.defer(b)}),g&&switchEditors.go(c,"toggle")},h.initialized?j():h.on("init",j),e.editorFocused=!1,i=function(){var a=300;h.isDirty()&&(wp.customize&&(wp.customize.state("processing").set(wp.customize.state("processing").get()+1),_.delay(function(){wp.customize.state("processing").set(wp.customize.state("processing").get()-1)},a)),h.save(),d.trigger("change"))},h.on("focus",function(){e.editorFocused=!0}),h.on("NodeChange",_.debounce(i,f)),h.on("blur",function(){e.editorFocused=!1,i()}),e.editor=h}}var c,d,e=this,f=1e3,g=!1;d=e.fields.text,c=d.attr("id"),b()}}),b.widgetControls={},b.handleWidgetAdded=function(c,d){var e,f,g,h,i,j,k,l,m=50;e=d.find("> .widget-inside > .form, > .widget-inside > form"),f=e.find("> .id_base").val(),"text"===f&&(h=e.find(".widget-id").val(),b.widgetControls[h]||(k=a("<div></div>"),l=d.find(".widget-content:first"),l.before(k),g=new b.TextWidgetControl({el:k,syncContainer:l}),b.widgetControls[h]=g,i=d.parent(),(j=function(){i.is(":animated")?setTimeout(j,m):g.initializeEditor()})()))},b.setupAccessibleMode=function(){var c,d,e,f,g;c=a(".editwidget > form"),0!==c.length&&(d=c.find("> .widget-control-actions > .id_base").val(),"text"===d&&(f=a("<div></div>"),g=c.find("> .widget-inside"),g.before(f),e=new b.TextWidgetControl({el:f,syncContainer:g}),e.initializeEditor()))},b.handleWidgetUpdated=function(a,c){var d,e,f,g;d=c.find("> .widget-inside > .form, > .widget-inside > form"),g=d.find("> .id_base").val(),"text"===g&&(e=d.find("> .widget-id").val(),f=b.widgetControls[e],f&&f.updateFields())},b.init=function(){var c=a(document);c.on("widget-added",b.handleWidgetAdded),c.on("widget-synced widget-updated",b.handleWidgetUpdated),a(function(){var c;"widgets"===window.pagenow&&(c=a(".widgets-holder-wrap:not(#available-widgets)").find("div.widget"),c.one("click.toggle-widget-expanded",function(){var c=a(this);b.handleWidgetAdded(new jQuery.Event("widget-added"),c)}),a(window).on("load",function(){b.setupAccessibleMode()}))})},b}(jQuery);
wp.textWidgets=function(a){"use strict";var b={};return b.TextWidgetControl=Backbone.View.extend({events:{},initialize:function(b){var c=this;if(!b.el)throw new Error("Missing options.el");if(!b.syncContainer)throw new Error("Missing options.syncContainer");Backbone.View.prototype.initialize.call(c,b),c.syncContainer=b.syncContainer,c.$el.addClass("text-widget-fields"),c.$el.html(wp.template("widget-text-control-fields")),c.fields={title:c.$el.find(".title"),text:c.$el.find(".text")},_.each(c.fields,function(b,d){b.on("input change",function(){var b=c.syncContainer.find("input[type=hidden]."+d);b.val()!==a(this).val()&&(b.val(a(this).val()),b.trigger("change"))}),b.val(c.syncContainer.find("input[type=hidden]."+d).val())})},updateFields:function(){var a,b=this;b.fields.title.is(document.activeElement)||(a=b.syncContainer.find("input[type=hidden].title"),b.fields.title.val(a.val())),a=b.syncContainer.find("input[type=hidden].text"),b.fields.text.is(":visible")?b.fields.text.is(document.activeElement)||b.fields.text.val(a.val()):b.editor&&!b.editorFocused&&a.val()!==b.fields.text.val()&&b.editor.setContent(wp.editor.autop(a.val()))},initializeEditor:function(){function b(){var h,i,j;if(document.getElementById(c)){if("undefined"==typeof window.tinymce)return void wp.editor.initialize(c,{quicktags:!0});if(tinymce.get(c)&&(g=tinymce.get(c).isHidden(),wp.editor.remove(c)),wp.editor.initialize(c,{tinymce:{wpautop:!0},quicktags:!0}),h=window.tinymce.get(c),!h)throw new Error("Failed to initialize editor");j=function(){a(h.getWin()).on("unload",function(){_.defer(b)}),g&&switchEditors.go(c,"toggle")},h.initialized?j():h.on("init",j),e.editorFocused=!1,i=function(){var a=300;h.isDirty()&&(wp.customize&&(wp.customize.state("processing").set(wp.customize.state("processing").get()+1),_.delay(function(){wp.customize.state("processing").set(wp.customize.state("processing").get()-1)},a)),h.save(),d.trigger("change"))},h.on("focus",function(){e.editorFocused=!0}),h.on("NodeChange",_.debounce(i,f)),h.on("blur",function(){e.editorFocused=!1,i()}),e.editor=h}}var c,d,e=this,f=1e3,g=!1;d=e.fields.text,c=d.attr("id"),b()}}),b.widgetControls={},b.handleWidgetAdded=function(c,d){var e,f,g,h,i,j,k,l,m=50;e=d.find("> .widget-inside > .form, > .widget-inside > form"),f=e.find("> .id_base").val(),"text"===f&&(h=e.find(".widget-id").val(),b.widgetControls[h]||(k=a("<div></div>"),l=d.find(".widget-content:first"),l.before(k),g=new b.TextWidgetControl({el:k,syncContainer:l}),b.widgetControls[h]=g,i=d.parent(),(j=function(){i.is(":animated")?setTimeout(j,m):g.initializeEditor()})()))},b.setupAccessibleMode=function(){var c,d,e,f,g;c=a(".editwidget > form"),0!==c.length&&(d=c.find("> .widget-control-actions > .id_base").val(),"text"===d&&(f=a("<div></div>"),g=c.find("> .widget-inside"),g.before(f),e=new b.TextWidgetControl({el:f,syncContainer:g}),e.initializeEditor()))},b.handleWidgetUpdated=function(a,c){var d,e,f,g;d=c.find("> .widget-inside > .form, > .widget-inside > form"),g=d.find("> .id_base").val(),"text"===g&&(e=d.find("> .widget-id").val(),f=b.widgetControls[e],f&&f.updateFields())},b.init=function(){var c=a(document);c.on("widget-added",b.handleWidgetAdded),c.on("widget-synced widget-updated",b.handleWidgetUpdated),a(function(){var c;"widgets"===window.pagenow&&(c=a(".widgets-holder-wrap:not(#available-widgets)").find("div.widget"),c.one("click.toggle-widget-expanded",function(){var c=a(this);b.handleWidgetAdded(new jQuery.Event("widget-added"),c)}),a(window).on("load",function(){b.setupAccessibleMode()}))})},b}(jQuery);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9-alpha-40994';
$wp_version = '4.9-alpha-40995';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.