Media modal: when inserting content, prefer the editor id passed while opening the modal. wpActiveEditor can change in the background. (Includes some precommit prefixed selectors.) Fixes #28173
git-svn-id: https://develop.svn.wordpress.org/trunk@29603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
15eb91dfdb
commit
2f81be2bbc
|
@ -1003,6 +1003,7 @@ th.action-links {
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-links .current {
|
.filter-links .current {
|
||||||
|
-webkit-box-shadow: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border-bottom: 4px solid #666;
|
border-bottom: 4px solid #666;
|
||||||
color: #222;
|
color: #222;
|
||||||
|
|
|
@ -1347,6 +1347,7 @@ div.action-links,
|
||||||
float: right;
|
float: right;
|
||||||
clear: right;
|
clear: right;
|
||||||
width: 65%;
|
width: 65%;
|
||||||
|
width: -webkit-calc( 100% - 180px );
|
||||||
width: calc( 100% - 180px );
|
width: calc( 100% - 180px );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* global getUserSetting, tinymce, QTags, wpActiveEditor */
|
/* global getUserSetting, tinymce, QTags */
|
||||||
|
|
||||||
// WordPress, TinyMCE, and Media
|
// WordPress, TinyMCE, and Media
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
@ -757,10 +757,15 @@
|
||||||
* @param {string} html Content to send to the editor
|
* @param {string} html Content to send to the editor
|
||||||
*/
|
*/
|
||||||
insert: function( html ) {
|
insert: function( html ) {
|
||||||
var editor,
|
var editor, wpActiveEditor,
|
||||||
hasTinymce = ! _.isUndefined( window.tinymce ),
|
hasTinymce = ! _.isUndefined( window.tinymce ),
|
||||||
hasQuicktags = ! _.isUndefined( window.QTags ),
|
hasQuicktags = ! _.isUndefined( window.QTags );
|
||||||
|
|
||||||
|
if ( this.activeEditor ) {
|
||||||
|
wpActiveEditor = window.wpActiveEditor = this.activeEditor;
|
||||||
|
} else {
|
||||||
wpActiveEditor = window.wpActiveEditor;
|
wpActiveEditor = window.wpActiveEditor;
|
||||||
|
}
|
||||||
|
|
||||||
// Delegate to the global `send_to_editor` if it exists.
|
// Delegate to the global `send_to_editor` if it exists.
|
||||||
// This attempts to play nice with any themes/plugins that have
|
// This attempts to play nice with any themes/plugins that have
|
||||||
|
@ -921,7 +926,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// If an empty `id` is provided, default to `wpActiveEditor`.
|
// If an empty `id` is provided, default to `wpActiveEditor`.
|
||||||
id = wpActiveEditor;
|
id = window.wpActiveEditor;
|
||||||
|
|
||||||
// If that doesn't work, fall back to `tinymce.activeEditor.id`.
|
// If that doesn't work, fall back to `tinymce.activeEditor.id`.
|
||||||
if ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) {
|
if ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) {
|
||||||
|
@ -1053,6 +1058,7 @@
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
|
||||||
id = this.id( id );
|
id = this.id( id );
|
||||||
|
this.activeEditor = id;
|
||||||
|
|
||||||
workflow = this.get( id );
|
workflow = this.get( id );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue