Changes between Version 2 and Version 3 of Ticket #12087, comment 4


Ignore:
Timestamp:
Jul 2, 2015, 3:21:03 PM (10 years ago)
Author:
ferahl
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12087, comment 4

    v2 v3  
    33
    44{{{
    5 onKeyDown: function(e) {
     5handleKeyDown: function(e) {
    66        if (e.which === KeyCodes.BACKSPACE || e.which === KeyCodes.DELETE) {
    77                var range = this.editor.getSelection().getRanges()[0];
     
    1515                }
    1616
    17                 // Is the previous node not a widget?
    18                 if (!startNode.getPrevious() ||
    19                         !startNode.getPrevious().$.dataset.ckeWidgetId) {
     17                var previousNode = startNode.getPrevious();
     18
     19                // Bail if the previous node is not a widget.
     20                if (previousNode &&
     21                        (!previousNode.$.dataset ||
     22                        !previousNode.$.dataset.ckeWidgetId)) {
    2023                        return;
    2124                }
     
    2427                if (!startNode.getText().trim()) {
    2528                        startNode.remove();
     29                        this.updateModel();
    2630                }
    2731        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy