Closed carled closed 7 years ago
Weird. Just reinstalled nuget package and this time it's brought through the wysiwyg.js files and dumped them in the "Scripts" root. I'll try using that one and see what happens.
Yup, that was it. Nuget install must have gone awry and now I've reinstalled, all is working as expected. Thanks,
Firstly it doesn't help that the nuget package doesn't include the "wysiwyg.js" file that contains the bindinghandler. When I downloaded the one from git, I get an error when trying to use "wordcount" and "isdirty".
The problem is at line 86 or thereabouts:
for ( var name in extensions ) { if ( extensions.hasOwnProperty( name ) ) { binding['extensions'][extensions[name]]( editor, e, args[2], args[4] ); } }
"extensions" is an array, so "name" in this instance is "0" and not "wordcount". Likewise the next iteration would look for "1" and not "isDirty".
Maybe I'm initialising it wrong? I'm doing this:
<textarea data-bind="wysiwyg : answerText, wysiwygDirty: TinyMCEIsDirty, wysiwygConfig: { plugins: [ 'wordcount' ] }, wysiwygExtensions: [ 'wordcount', 'dirty' ], wysiwygWordCount: TinyMCEWordCount"></textarea>