Set contentEditable using jQuery#prop

Also always use strings 'true'/'false' for the value, because
it is a string property (spellcheck, however, is a boolean)
and always use a capital second 'E' in the name.

Change-Id: Ia4e1f9edfd8f236fe81df190e6a68729d7b52243
This commit is contained in:
Ed Sanders 2013-08-28 16:20:47 -07:00
parent 458f8d1a82
commit 98cad0f410
4 changed files with 6 additions and 6 deletions

View file

@ -21,7 +21,7 @@ ve.ce.MWEntityNode = function VeCeMWEntityNode( model, config ) {
// DOM changes
this.$.addClass( 've-ce-mwEntityNode' );
// Need CE=false to prevent selection issues
this.$.attr( 'contenteditable', false );
this.$.prop( 'contentEditable', 'false' );
// Events
this.model.connect( this, { 'update': 'onUpdate' } );

View file

@ -27,7 +27,7 @@ ve.ce.DocumentNode = function VeCeDocumentNode( model, surface, config ) {
// DOM changes
this.$.addClass( 've-ce-documentNode' );
this.$.attr( { 'contentEditable': 'true', 'spellcheck': 'true' } );
this.$.prop( { 'contentEditable': 'true', 'spellcheck': true } );
};
/* Inheritance */
@ -68,7 +68,7 @@ ve.ce.DocumentNode.prototype.getSurface = function () {
* @method
*/
ve.ce.DocumentNode.prototype.disable = function () {
this.$.attr( 'contentEditable', 'false' );
this.$.prop( 'contentEditable', 'false' );
};
/**
@ -77,7 +77,7 @@ ve.ce.DocumentNode.prototype.disable = function () {
* @method
*/
ve.ce.DocumentNode.prototype.enable = function () {
this.$.attr( 'contentEditable', 'true' );
this.$.prop( 'contentEditable', 'true' );
};
/* Registration */

View file

@ -28,7 +28,7 @@ ve.ce.ProtectedNode = function VeCeProtectedNode() {
// DOM changes
this.$
.addClass( 've-ce-protectedNode' )
.prop( 'contentEditable', false );
.prop( 'contentEditable', 'false' );
};
/* Static Properties */

View file

@ -82,7 +82,7 @@ ve.ce.Surface = function VeCeSurface( model, surface, options ) {
this.$.addClass( 've-ce-surface' );
this.$phantoms.addClass( 've-ce-surface-phantoms' );
this.$highlights.addClass( 've-ce-surface-highlights' );
this.$pasteTarget.addClass( 've-ce-surface-paste' ).prop( 'contenteditable', true );
this.$pasteTarget.addClass( 've-ce-surface-paste' ).prop( 'contentEditable', 'true' );
// Add elements to the DOM
this.$.append( this.documentView.getDocumentNode().$, this.$pasteTarget );