Skip to content

Commit

Permalink
Return null from getSelection when not in wysiwyg mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Sep 11, 2013
1 parent f8d97f2 commit ddf9074
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/selection.js
Expand Up @@ -39,7 +39,7 @@
sel = this.getSelection( 1 );

// Editor may have no selection at all.
if ( sel.getType() == CKEDITOR.SELECTION_NONE )
if ( !sel || sel.getType() == CKEDITOR.SELECTION_NONE )
return;
}

Expand Down Expand Up @@ -630,9 +630,9 @@
if ( ( this._.savedSelection || this._.fakeSelection ) && !forceRealSelection )
return this._.savedSelection || this._.fakeSelection;

// Editable element might be absent.
// Editable element might be absent or editor might not be in a wysiwyg mode.
var editable = this.editable();
return editable ? new CKEDITOR.dom.selection( editable ) : null;
return editable && this.mode == 'wysiwyg' ? new CKEDITOR.dom.selection( editable ) : null;
};

/**
Expand Down

0 comments on commit ddf9074

Please sign in to comment.