mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 23:27:39 +02:00
In media-editor.js
, use _.isUndefined()
when available.
See #26631. Built from https://develop.svn.wordpress.org/trunk@27317 git-svn-id: http://core.svn.wordpress.org/trunk@27169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d896fa2487
commit
cf1d899cc8
@ -212,7 +212,7 @@
|
|||||||
props = wp.media.string.props( props, attachment );
|
props = wp.media.string.props( props, attachment );
|
||||||
classes = props.classes || [];
|
classes = props.classes || [];
|
||||||
|
|
||||||
img.src = typeof attachment !== 'undefined' ? attachment.url : props.url;
|
img.src = ! _.isUndefined( attachment ) ? attachment.url : props.url;
|
||||||
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
|
_.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
|
||||||
|
|
||||||
// Only assign the align class to the image if we're not printing
|
// Only assign the align class to the image if we're not printing
|
||||||
@ -279,7 +279,7 @@
|
|||||||
|
|
||||||
return _.extend( attributes, {
|
return _.extend( attributes, {
|
||||||
coerce: function ( attrs, key ) {
|
coerce: function ( attrs, key ) {
|
||||||
if ( 'undefined' === typeof attrs[ key ] && 'undefined' !== typeof this.defaults[ key ] ) {
|
if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) {
|
||||||
attrs[ key ] = this.defaults[ key ];
|
attrs[ key ] = this.defaults[ key ];
|
||||||
} else if ( 'true' === attrs[ key ] ) {
|
} else if ( 'true' === attrs[ key ] ) {
|
||||||
attrs[ key ] = true;
|
attrs[ key ] = true;
|
||||||
@ -632,8 +632,8 @@
|
|||||||
*/
|
*/
|
||||||
insert: function( html ) {
|
insert: function( html ) {
|
||||||
var editor,
|
var editor,
|
||||||
hasTinymce = typeof tinymce !== 'undefined',
|
hasTinymce = ! _.isUndefined( tinymce ),
|
||||||
hasQuicktags = typeof QTags !== 'undefined',
|
hasQuicktags = ! _.isUndefined( QTags ),
|
||||||
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.
|
||||||
@ -798,7 +798,7 @@
|
|||||||
id = wpActiveEditor;
|
id = 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 && typeof tinymce !== 'undefined' && tinymce.activeEditor ) {
|
if ( ! id && ! _.isUndefined( tinymce ) && tinymce.activeEditor ) {
|
||||||
id = tinymce.activeEditor.id;
|
id = tinymce.activeEditor.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,7 +929,7 @@
|
|||||||
id = this.id( id );
|
id = this.id( id );
|
||||||
/*
|
/*
|
||||||
// Save a bookmark of the caret position in IE.
|
// Save a bookmark of the caret position in IE.
|
||||||
if ( typeof tinymce !== 'undefined' ) {
|
if ( ! _.isUndefined( tinymce ) ) {
|
||||||
editor = tinymce.get( id );
|
editor = tinymce.get( id );
|
||||||
|
|
||||||
if ( tinymce.isIE && editor && ! editor.isHidden() ) {
|
if ( tinymce.isIE && editor && ! editor.isHidden() ) {
|
||||||
|
2
wp-includes/js/media-editor.min.js
vendored
2
wp-includes/js/media-editor.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user