X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fdialog%2Fplugin.js;h=9927ebee360fb8d32cd6420a59c29808daa677d0;hb=e371ddf8abcb89013e20e6d0dd746adec344d0e5;hp=917d2dd0e371940840514afe96fa3af88b572b8c;hpb=055b6b0792ce7dc53d47af606b367c04b927c2ab;p=ckeditor.git diff --git a/_source/plugins/dialog/plugin.js b/_source/plugins/dialog/plugin.js index 917d2dd..9927ebe 100644 --- a/_source/plugins/dialog/plugin.js +++ b/_source/plugins/dialog/plugin.js @@ -472,7 +472,10 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; // Insert the tabs and contents. for ( var i = 0 ; i < definition.contents.length ; i++ ) - this.addPage( definition.contents[i] ); + { + var page = definition.contents[i]; + page && this.addPage( page ); + } this.parts['tabs'].on( 'click', function( evt ) { @@ -480,8 +483,10 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; // If we aren't inside a tab, bail out. if ( target.hasClass( 'cke_dialog_tab' ) ) { + // Get the ID of the tab, without the 'cke_' prefix and the unique number suffix. var id = target.$.id; - this.selectPage( id.substr( 0, id.lastIndexOf( '_' ) ) ); + this.selectPage( id.substring( 4, id.lastIndexOf( '_' ) ) ); + if ( this._.tabBarMode ) { this._.tabBarMode = false; @@ -881,7 +886,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; page.setAttribute( 'role', 'tabpanel' ); var env = CKEDITOR.env; - var tabId = contents.id + '_' + CKEDITOR.tools.getNextNumber(), + var tabId = 'cke_' + contents.id + '_' + CKEDITOR.tools.getNextNumber(), tab = CKEDITOR.dom.element.createFromHtml( [ ' 0 ? ' cke_last' : 'cke_first' ), @@ -1386,7 +1391,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; // Transform the contents entries in contentObjects. var contents = dialogDefinition.contents; for ( var i = 0, content ; ( content = contents[i] ) ; i++ ) - contents[ i ] = new contentObject( dialog, content ); + contents[ i ] = content && new contentObject( dialog, content ); CKEDITOR.tools.extend( this, dialogDefinition ); }; @@ -2051,7 +2056,7 @@ CKEDITOR.DIALOG_RESIZE_BOTH = 3; styles = ( stylesArg && stylesArg.call ? stylesArg( elementDefinition ) : stylesArg ) || {}, attributes = ( attributesArg && attributesArg.call ? attributesArg( elementDefinition ) : attributesArg ) || {}, innerHTML = ( contentsArg && contentsArg.call ? contentsArg.call( this, dialog, elementDefinition ) : contentsArg ) || '', - domId = this.domId = attributes.id || CKEDITOR.tools.getNextNumber() + '_uiElement', + domId = this.domId = attributes.id || CKEDITOR.tools.getNextId() + '_uiElement', id = this.id = elementDefinition.id, i;