Hide post title field in DFW if title is not supported by the current post type or missing, fixes $18568

git-svn-id: http://svn.automattic.com/wordpress/trunk@18828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz
2011-09-29 22:59:49 +00:00
parent 32e25b6aec
commit 3be0b41d68
4 changed files with 10 additions and 6 deletions

View File

@@ -139,8 +139,8 @@ PubSub.prototype.publish = function( topic, args ) {
// Settings can be added or changed by defining "wp_fullscreen_settings" JS object.
// This can be done by defining it as PHP array and passing it to JS with:
// wp_add_script_data( 'wp-fullscreen', 'wp_fullscreen_settings', $settings_array )
if ( typeof(wp_fullscreen_settings) != 'undefined' )
// add_script_data( 'wp-fullscreen', 'wp_fullscreen_settings', $settings_array )
if ( typeof(wp_fullscreen_settings) == 'object' )
$.extend( s, wp_fullscreen_settings );
s.editor_id = wpActiveEditor || 'content';
@@ -148,8 +148,10 @@ PubSub.prototype.publish = function( topic, args ) {
if ( !s.title_id ) {
if ( $('input#title').length && s.editor_id == 'content' )
s.title_id = 'title';
else if ( $('input#' + s.editor_id + '-title').length ) // the title input field should have [editor_id]-title HTML ID to be auto detected
s.title_id = s.editor_id + '-title';
else
$('#wp-fullscreen-title').hide();
$('#wp-fullscreen-title, #wp-fullscreen-title-prompt-text').hide();
}
s.mode = $('#' + s.editor_id).is(':hidden') ? 'tinymce' : 'html';
@@ -536,7 +538,7 @@ PubSub.prototype.publish = function( topic, args ) {
if ( !s.has_tinymce )
$('#wp-fullscreen-mode-bar').hide();
if ( wptitlehint )
if ( wptitlehint && $('#wp-fullscreen-title').length )
wptitlehint('wp-fullscreen-title');
$(document).keyup(function(e){