Skip to content

Commit

Permalink
Merge pull request #73 from tremby/wysihtml5
Browse files Browse the repository at this point in the history
---

This is tiff/wysihtml5#461 which I wrote last year some
time, rebased on to your fork.

This patch allows the classes set on toolbar buttons to be set in the wysihtml5
configuration, as `classNameCommandDisabled`, `classNameCommandsDisabled`,
`classNameCommandActive`, `classNameActionActive`. I already have disabled and
active classes provided by Twitter Bootstrap and dont want to trawl through
the source files and apply all relevant styles to wysihtml5-specific classes
too -- this is a very nice short cut.
  • Loading branch information
Oliver Pulges committed Aug 21, 2014
2 parents 5525a1b + b25f36f commit 383d7ae
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
13 changes: 13 additions & 0 deletions dist/wysihtml5x-toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13478,6 +13478,19 @@ wysihtml5.views.View = Base.extend(
this._observe();
if (showOnInit) { this.show(); }

if (editor.config.classNameCommandDisabled != null) {
CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;
}
if (editor.config.classNameCommandsDisabled != null) {
CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;
}
if (editor.config.classNameCommandActive != null) {
CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;
}
if (editor.config.classNameActionActive != null) {
CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;
}

var speechInputLinks = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
length = speechInputLinks.length,
i = 0;
Expand Down
4 changes: 2 additions & 2 deletions dist/wysihtml5x-toolbar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wysihtml5x-toolbar.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wysihtml5x.min.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions src/toolbar/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@
this._observe();
if (showOnInit) { this.show(); }

if (editor.config.classNameCommandDisabled != null) {
CLASS_NAME_COMMAND_DISABLED = editor.config.classNameCommandDisabled;
}
if (editor.config.classNameCommandsDisabled != null) {
CLASS_NAME_COMMANDS_DISABLED = editor.config.classNameCommandsDisabled;
}
if (editor.config.classNameCommandActive != null) {
CLASS_NAME_COMMAND_ACTIVE = editor.config.classNameCommandActive;
}
if (editor.config.classNameActionActive != null) {
CLASS_NAME_ACTION_ACTIVE = editor.config.classNameActionActive;
}

var speechInputLinks = this.container.querySelectorAll("[data-wysihtml5-command=insertSpeech]"),
length = speechInputLinks.length,
i = 0;
Expand Down

0 comments on commit 383d7ae

Please sign in to comment.