0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Code style/naming convention cleanups

This commit is contained in:
Neil Jenkins 2015-05-07 09:08:58 +07:00
parent 8d8798a673
commit c48e9b73f5
3 changed files with 18 additions and 22 deletions

View file

@ -1505,7 +1505,7 @@ function Squire ( doc, config ) {
this._keyHandlers = Object.create( keyHandlers ); this._keyHandlers = Object.create( keyHandlers );
// Override default properties // Override default properties
this.initConfig( config ); this.setConfig( config );
// Fix IE<10's buggy implementation of Text#splitText. // Fix IE<10's buggy implementation of Text#splitText.
// If the split is at the end of the node, it doesn't insert the newly split // If the split is at the end of the node, it doesn't insert the newly split
@ -1546,22 +1546,20 @@ function Squire ( doc, config ) {
instances.push( this ); instances.push( this );
// For fixCursor would query instance by doc first, // Need to register instance before calling setHTML, so that the fixCursor
// we initialize HTML after instance saved // function can lookup any default block tag options set.
this.setHTML( '' ); this.setHTML( '' );
} }
var proto = Squire.prototype; var proto = Squire.prototype;
proto.initConfig = function ( config ) { proto.setConfig = function ( config ) {
var prop; for ( var prop in config ) {
if (config) { if ( config.hasOwnProperty( prop ) ) {
for ( prop in config ) { this[ prop ] = config[ prop ];
if ( config.hasOwnProperty(prop) ) {
this[prop] = config[prop];
}
} }
} }
return this;
}; };
proto.createElement = function ( tag, props, children ) { proto.createElement = function ( tag, props, children ) {

File diff suppressed because one or more lines are too long

View file

@ -81,7 +81,7 @@ function Squire ( doc, config ) {
this._keyHandlers = Object.create( keyHandlers ); this._keyHandlers = Object.create( keyHandlers );
// Override default properties // Override default properties
this.initConfig( config ); this.setConfig( config );
// Fix IE<10's buggy implementation of Text#splitText. // Fix IE<10's buggy implementation of Text#splitText.
// If the split is at the end of the node, it doesn't insert the newly split // If the split is at the end of the node, it doesn't insert the newly split
@ -122,22 +122,20 @@ function Squire ( doc, config ) {
instances.push( this ); instances.push( this );
// For fixCursor would query instance by doc first, // Need to register instance before calling setHTML, so that the fixCursor
// we initialize HTML after instance saved // function can lookup any default block tag options set.
this.setHTML( '' ); this.setHTML( '' );
} }
var proto = Squire.prototype; var proto = Squire.prototype;
proto.initConfig = function ( config ) { proto.setConfig = function ( config ) {
var prop; for ( var prop in config ) {
if (config) { if ( config.hasOwnProperty( prop ) ) {
for ( prop in config ) { this[ prop ] = config[ prop ];
if ( config.hasOwnProperty(prop) ) {
this[prop] = config[prop];
}
} }
} }
return this;
}; };
proto.createElement = function ( tag, props, children ) { proto.createElement = function ( tag, props, children ) {