Skip to content

Commit

Permalink
AO3-2898 update character count from tinymce
Browse files Browse the repository at this point in the history
  • Loading branch information
slavalamp committed Jan 22, 2025
1 parent 092aa07 commit 7b25b9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 8 additions & 0 deletions public/javascripts/mce_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ tinyMCE.init({
// As of version 5.0, TinyMCE has a very limited mobile version it inflicts on Android and iOS phones by default.
// This forces the desktop version. Note that this is only implicitly documented and may break.
theme: "silver",
},

setup: function (editor) {
// Update character count when switching to and editing in TinyMCE
editor.on('init change undo redo', function() {
editor.save();
$j(editor.targetElm).trigger('change');
})
}
});

Expand Down
4 changes: 1 addition & 3 deletions public/javascripts/mce_editor.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7b25b9c

Please sign in to comment.