Skip to content

Commit

Permalink
проверка SwitchMode
Browse files Browse the repository at this point in the history
  • Loading branch information
Katochimoto committed Sep 5, 2015
1 parent 31db44f commit 4903b5e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,15 @@

editor.on('mode', function() {
var button = this.ui.get('SwitchMode');
var newIconNode = CKEDITOR.dom.element.createFromHtml(CKEDITOR.getTemplate('buttonSVGIconState').output({
'id': button._.id,
'iconName': 'switchmode',
'state': (this.mode === 'wysiwyg' ? 'on' : 'off')
}));
if (button) {
var newIconNode = CKEDITOR.dom.element.createFromHtml(CKEDITOR.getTemplate('buttonSVGIconState').output({
'id': button._.id,
'iconName': 'switchmode',
'state': (this.mode === 'wysiwyg' ? 'on' : 'off')
}));

newIconNode.replace(button.getElementIcon());
newIconNode.replace(button.getElementIcon());
}
});
}
});
Expand Down

0 comments on commit 4903b5e

Please sign in to comment.