editor-para.js revision d0bccce76452becc96b65acaaa684aa6fabaf386
/**
* Plugin for Editor to paragraph auto wrapping and correction.
* @module editor
* @submodule editor-para
*/
/**
* Plugin for Editor to paragraph auto wrapping and correction.
* @class Plugin.EditorPara
* @extends Base
* @constructor
*/
var EditorPara = function() {
/**
* Utility method to create an empty paragraph when the document is empty.
* @private
* @method _fixFirstPara
*/
_fixFirstPara: function() {
sel.focusCursor(true, false);
},
/**
* nodeChange handler to handle fixing an empty document.
* @private
* @method _onNodeChange
*/
_onNodeChange: function(e) {
switch (e.changedType) {
case 'keydown':
this._fixFirstPara();
}
}
break;
case 'backspace-up':
case 'delete-up':
}
this._fixFirstPara();
e.changedEvent.halt();
}
}
break;
}
},
/**
* Performs a block element filter when the Editor is first ready
* @private
* @method _afterEditorReady
*/
_afterEditorReady: function() {
if (inst) {
}
},
/**
* Performs a block element filter when the Editor after an content change
* @private
* @method _afterContentChange
*/
_afterContentChange: function() {
}
},
/**
* @private
* @method _afterPaste
*/
_afterPaste: function() {
});
},
initializer: function() {
}
}
}, {
/**
* editorPara
* @static
* @property NAME
*/
NAME: 'editorPara',
/**
* editorPara
* @static
* @property NS
*/
NS: 'editorPara',
ATTRS: {
host: {
value: false
}
}
});
Y.namespace('Plugin');