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:
Andrew Ozz 2014-08-25 19:36:12 +00:00
parent 15eb91dfdb
commit 2f81be2bbc
3 changed files with 12 additions and 4 deletions

View File

@ -1003,6 +1003,7 @@ th.action-links {
}
.filter-links .current {
-webkit-box-shadow: none;
box-shadow: none;
border-bottom: 4px solid #666;
color: #222;

View File

@ -1347,6 +1347,7 @@ div.action-links,
float: right;
clear: right;
width: 65%;
width: -webkit-calc( 100% - 180px );
width: calc( 100% - 180px );
}

View File

@ -1,4 +1,4 @@
/* global getUserSetting, tinymce, QTags, wpActiveEditor */
/* global getUserSetting, tinymce, QTags */
// WordPress, TinyMCE, and Media
// -----------------------------
@ -757,10 +757,15 @@
* @param {string} html Content to send to the editor
*/
insert: function( html ) {
var editor,
var editor, wpActiveEditor,
hasTinymce = ! _.isUndefined( window.tinymce ),
hasQuicktags = ! _.isUndefined( window.QTags ),
hasQuicktags = ! _.isUndefined( window.QTags );
if ( this.activeEditor ) {
wpActiveEditor = window.wpActiveEditor = this.activeEditor;
} else {
wpActiveEditor = window.wpActiveEditor;
}
// Delegate to the global `send_to_editor` if it exists.
// This attempts to play nice with any themes/plugins that have
@ -921,7 +926,7 @@
}
// 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 ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) {
@ -1053,6 +1058,7 @@
options = options || {};
id = this.id( id );
this.activeEditor = id;
workflow = this.get( id );