insert <br /> on ctrl-enter press

master
vitalif 2012-10-04 23:03:22 +00:00 committed by Vitaliy Filippov
parent 7e9300e4ff
commit c99de8e89f
1 changed files with 11 additions and 2 deletions

View File

@ -530,6 +530,15 @@ var nicEditorInstance = bkClass.extend({
}, },
keyDown : function(e,t) { keyDown : function(e,t) {
if(e.keyCode == 13 || e.keyCode == 10) {
if (!e.ctrlKey) {
this.ne.nicCommand('insertHTML','<p></p>');
} else {
this.ne.nicCommand('insertHTML','<br />');
}
e.preventDefault();
return false;
}
if(e.ctrlKey) { if(e.ctrlKey) {
this.ne.fireEvent('key',this,e); this.ne.fireEvent('key',this,e);
} }
@ -1050,7 +1059,7 @@ nicEditors.registerPlugin(nicButtonTips);
/* START CONFIG */ /* START CONFIG */
var nicSelectOptions = { var nicSelectOptions = {
buttons : { buttons : {
'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'}, 'fontSize' : {name : __('Select Font Size'), type : 'nicEditorFontSizeSelect', command : 'fontsize'},
@ -1654,7 +1663,7 @@ var nicTableButton = nicEditorAdvancedButton.extend({
this.t = this.findElm('TABLE','title',tmp); this.t = this.findElm('TABLE','title',tmp);
} }
if(this.t) { if(this.t) {
this.t.title = ''; this.t.remoteAttribute('title');
for (i = r; i < this.t.rows.length; i++) { for (i = r; i < this.t.rows.length; i++) {
this.t.deleteRow(r); this.t.deleteRow(r);
} }