X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fdialogs%2Fselect.js;h=b897bdf89c009b9709b55d21cad981e33ab99670;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=c8b43d39ee0e8f96ec8f79ab3a661e85b7af2024;hpb=8761695d9b70afe75905deaac88f78c1f8aeb32d;p=ckeditor.git diff --git a/_source/plugins/forms/dialogs/select.js b/_source/plugins/forms/dialogs/select.js index c8b43d3..b897bdf 100644 --- a/_source/plugins/forms/dialogs/select.js +++ b/_source/plugins/forms/dialogs/select.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.dialog.add( 'select', function( editor ) @@ -73,7 +73,7 @@ CKEDITOR.dialog.add( 'select', function( editor ) function removeAllOptions( combo ) { combo = getSelect( combo ); - while( combo.getChild( 0 ) && combo.getChild( 0 ).remove() ) + while ( combo.getChild( 0 ) && combo.getChild( 0 ).remove() ) { /*jsl:pass*/ } } // Moves the selected option by a number of steps (also negative). @@ -160,7 +160,18 @@ CKEDITOR.dialog.add( 'select', function( editor ) this.commitContent( element ); if ( isInsertMode ) + { editor.insertElement( element ); + if ( CKEDITOR.env.ie ) + { + var sel = editor.getSelection(), + bms = sel.createBookmarks(); + setTimeout(function() + { + sel.selectBookmarks( bms ); + }, 0 ); + } + } }, contents : [ { @@ -182,11 +193,11 @@ CKEDITOR.dialog.add( 'select', function( editor ) setup : function( name, element ) { if ( name == 'clear' ) - this.setValue( '' ); + this.setValue( this[ 'default' ] || '' ); else if ( name == 'select' ) { this.setValue( - element.getAttribute( '_cke_saved_name' ) || + element.data( 'cke-saved-name' ) || element.getAttribute( 'name' ) || '' ); } @@ -194,10 +205,10 @@ CKEDITOR.dialog.add( 'select', function( editor ) commit : function( element ) { if ( this.getValue() ) - element.setAttribute( '_cke_saved_name', this.getValue() ); + element.data( 'cke-saved-name', this.getValue() ); else { - element.removeAttribute( '_cke_saved_name' ) ; + element.data( 'cke-saved-name', false ); element.removeAttribute( 'name' ); } }