From 4415b03f36ab6f2c84200e229d8ce4448448afd2 Mon Sep 17 00:00:00 2001 From: macjohnny Date: Thu, 3 Jul 2014 12:13:36 +0200 Subject: [PATCH 1/2] fix backspace problem in chrome/safari see http://yuilibrary.com/trac-archive/tickets/2532834.html for detailed problem description fixes #2532834, but reopens #2531090, which is imho not as important as the backspace problem, since this makes the editor unusable. --- src/editor/js/editor-base.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/editor/js/editor-base.js b/src/editor/js/editor-base.js index 049dc3bd238..ae1b5d489df 100644 --- a/src/editor/js/editor-base.js +++ b/src/editor/js/editor-base.js @@ -179,12 +179,6 @@ } } break; - case 'backspace-up': - // Fixes #2531090 - Joins text node strings so they become one for bidi - if (Y.UA.webkit && e.changedNode) { - e.changedNode.set('innerHTML', e.changedNode.get('innerHTML')); - } - break; } if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) { /* From 028b6ee51dcf1272415b945cac205d2c1b2821f0 Mon Sep 17 00:00:00 2001 From: macjohnny Date: Fri, 25 Jul 2014 08:30:24 +0200 Subject: [PATCH 2/2] Update editor-base.js --- src/editor/js/editor-base.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/editor/js/editor-base.js b/src/editor/js/editor-base.js index ae1b5d489df..887f3ff114b 100644 --- a/src/editor/js/editor-base.js +++ b/src/editor/js/editor-base.js @@ -165,21 +165,20 @@ * to walk through and filter to pass off the event to before firing.. */ - switch (e.changedType) { - case 'tab': - if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) { - e.changedEvent.frameEvent.preventDefault(); - Y.log('Overriding TAB key to insert HTML: HALTING', 'info', 'editor'); - if (Y.UA.webkit) { - this.execCommand('inserttext', '\t'); - } else if (Y.UA.gecko) { - this.frame.exec._command('inserthtml', EditorBase.TABKEY); - } else if (Y.UA.ie) { - this.execCommand('inserthtml', EditorBase.TABKEY); - } + if (e.changedType === 'tab') { + if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) { + e.changedEvent.frameEvent.preventDefault(); + Y.log('Overriding TAB key to insert HTML: HALTING', 'info', 'editor'); + if (Y.UA.webkit) { + this.execCommand('inserttext', '\t'); + } else if (Y.UA.gecko) { + this.frame.exec._command('inserthtml', EditorBase.TABKEY); + } else if (Y.UA.ie) { + this.execCommand('inserthtml', EditorBase.TABKEY); } - break; + } } + if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) { /* * When executing execCommand 'indent or 'outdent' Webkit applies