liluxdev / summernote-addclass

A plugin for summernote editor to allow user to add custom css classes (custom styling) to the selected elements
MIT License
33 stars 16 forks source link

Still working? #3

Open aploessl opened 7 years ago

aploessl commented 7 years ago

I tried your demo/jsfiddle, and it shows styled elements, but I could not change them. Has an update to summernote done something with the capabilities of this plugin?

aploessl commented 7 years ago

seems to be in this portion of the code:

var $node = $(context.invoke("restoreTarget")); //var $node = $(this.restoreTarget()); console.log('node1callval:' + $node.html()); if (($node.length == 0) || ($node == 'undefined')) { $node = $(document.getSelection().focusNode.parentElement, ".note-editable"); } console.log('node2callval:' + $node.html()); console.log('node3callval:' + $(document.getSelection().focusNode.parentElement, ".note-editable").html()); if (typeof context.options.addclass !== 'undefined' && typeof context.options.addclass.debug !== 'undefined' && context.options.addclass.debug) { console.debug(context.invoke("restoreTarget"), $node, "toggling class: " + value, window.getSelection()); }

$node seems to always return 'undefined' (I added the console.log statements to check values as actions were being taken with the plugin).

WaKeMaTTa commented 7 years ago

I'm using summernote v0.8.3 and it works. :+1: