editor: minor usability tweak
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Apr 2014 07:13:59 +0000 (09:13 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 24 Apr 2014 07:13:59 +0000 (09:13 +0200)
Make toolbar paragraph/header icon active even when already
in a paragraph/header.

src/editor/plugins/core/switch.js

index ff49eb8..edb8e95 100644 (file)
@@ -41,7 +41,7 @@ var createSwitchAction = function(createParams) {
 
             description = gettext('Switch to') + ' ' + createParams.to.name;
             return _.extend(state, {
-                allowed: !!toSwitch,
+                allowed: !!toSwitch || alreadyInTarget,
                 toggled: alreadyInTarget,
                 description: description,
                 execute: alreadyInTarget ? function() {} : function(callback) {