Skip to content

Commit

Permalink
Port fix to #188 from wymeditor into our application too.
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Aug 19, 2010
1 parent 1e6cb22 commit 0aca005
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions public/javascripts/wymeditor/jquery.refinery.wymeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -4969,19 +4969,23 @@ WYMeditor.WymClassSafari.prototype.addCssRule = function(styles, oCss) {
//keydown handler, mainly used for keyboard shortcuts
WYMeditor.WymClassSafari.prototype.keydown = function(e) {

if(e.ctrlKey){
//'this' is the doc
var wym = WYMeditor.INSTANCES[this.title];
//'this' is the doc
var wym = WYMeditor.INSTANCES[this.title];

if(e.keyCode == 66) {
if(e.ctrlKey){
if(e.keyCode == 66){
//CTRL+b => STRONG
wym._exec(WYMeditor.BOLD);
return false;
} else if(e.keyCode == 73) {
e.preventDefault();
}
if(e.keyCode == 73){
//CTRL+i => EMPHASIS
wym._exec(WYMeditor.ITALIC);
return false;
e.preventDefault();
}
} else if(e.shiftKey && e.keyCode == 13) {
wym._exec('InsertLineBreak');
e.preventDefault();
}
};

Expand All @@ -5007,10 +5011,6 @@ WYMeditor.WymClassSafari.prototype.keyup = function(e) {
}
}

//fix #112
if(e.keyCode == 13 && e.shiftKey) {
wym._exec('InsertLineBreak');
}
else if(($.inArray(e.keyCode, [8, 17, 46, 224]) == -1) && !e.metaKey && !e.ctrlKey)
{
//NOT BACKSPACE, NOT DELETE, NOT CTRL, NOT COMMAND
Expand Down

0 comments on commit 0aca005

Please sign in to comment.