Browse Source

Avoid errors in case of textnode selection

pull/1551/head
Artur Arseniev 8 years ago
parent
commit
b725991128
  1. 14
      src/commands/view/SelectComponent.js

14
src/commands/view/SelectComponent.js

@ -330,10 +330,11 @@ module.exports = {
// Get the selected model directly from the Editor as the event might
// be triggered manually without the model
const model = this.em.getSelected();
const view = model && model.view;
this.updateToolbar(model);
if (model) {
const el = model.view.el;
if (view) {
const { el } = view;
this.showFixedElementOffset(el);
this.hideElementOffset();
this.hideHighlighter();
@ -589,11 +590,12 @@ module.exports = {
*/
updateAttached(updated) {
const model = this.em.getSelected();
const view = model && model.view;
if (model) {
var view = model.view;
this.updateToolbarPos(view.el);
this.showFixedElementOffset(view.el);
if (view) {
const { el } = view;
this.updateToolbarPos(el);
this.showFixedElementOffset(el);
}
},

Loading…
Cancel
Save