X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fforms%2Fdialogs%2Fcheckbox.js;h=b36526d97a139d7032adb8530a78d7e3ca49c6fd;hb=614511639979907ceb0da3614122a4d8eb963ad4;hp=021163bb098571a2c8b37a76824986c28fc197ea;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d;p=ckeditor.git diff --git a/_source/plugins/forms/dialogs/checkbox.js b/_source/plugins/forms/dialogs/checkbox.js index 021163b..b36526d 100644 --- a/_source/plugins/forms/dialogs/checkbox.js +++ b/_source/plugins/forms/dialogs/checkbox.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( 'checkbox', function( editor ) @@ -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 : [ @@ -91,7 +89,19 @@ CKEDITOR.dialog.add( 'checkbox', function( editor ) if ( value && !( CKEDITOR.env.ie && value == 'on' ) ) element.setAttribute( 'value', value ); else - element.removeAttribute( 'value' ); + { + if ( CKEDITOR.env.ie ) + { + // Remove attribute 'value' of checkbox (#4721). + var checkbox = new CKEDITOR.dom.element( 'input', element.getDocument() ); + element.copyAttributes( checkbox, { value: 1 } ); + checkbox.replace( element ); + editor.getSelection().selectElement( checkbox ); + data.element = checkbox; + } + else + element.removeAttribute( 'value' ); + } } }, { @@ -111,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 ) {