X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fforms%2Fdialogs%2Fcheckbox.js;h=b36526d97a139d7032adb8530a78d7e3ca49c6fd;hp=92bcddbcd0b6272dfbdde754760fa8d824884db5;hb=039a051ccf3901311661022a30afd60fc38130c9;hpb=c9fdde67e6384bd5a66adc2b3bba5c4ce9db56c7 diff --git a/_source/plugins/forms/dialogs/checkbox.js b/_source/plugins/forms/dialogs/checkbox.js index 92bcddb..b36526d 100644 --- a/_source/plugins/forms/dialogs/checkbox.js +++ b/_source/plugins/forms/dialogs/checkbox.js @@ -14,7 +14,7 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) var element = this.getParentEditor().getSelection().getSelectedElement(); - if ( element && element.getAttribute( 'type' ) == "checkbox" ) + if ( element && element.getAttribute( 'type' ) == 'checkbox' ) { this.checkbox = element; this.setupContent( element ); @@ -31,10 +31,8 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) editor = this.getParentEditor(); element = editor.document.createElement( 'input' ); element.setAttribute( 'type', 'checkbox' ); - } - - if ( isInsertMode ) editor.insertElement( element ); + } this.commitContent( { element : element } ); }, contents : [ @@ -94,7 +92,7 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) { if ( CKEDITOR.env.ie ) { - // Remove attribute 'value' of checkbox #4721. + // Remove attribute 'value' of checkbox (#4721). var checkbox = new CKEDITOR.dom.element( 'input', element.getDocument() ); element.copyAttributes( checkbox, { value: 1 } ); checkbox.replace( element ); @@ -123,8 +121,8 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) if ( CKEDITOR.env.ie ) { - var isElementChecked = !!element.getAttribute( 'checked' ); - var isChecked = !!this.getValue(); + var isElementChecked = !!element.getAttribute( 'checked' ), + isChecked = !!this.getValue(); if ( isElementChecked != isChecked ) {