wermerb / ngx-trumbowyg

Angular 6 component & directive for Trumbowyg WYSIWYG editor.
MIT License
4 stars 6 forks source link

A problem with color plugin #11

Open caseyryan opened 5 years ago

caseyryan commented 5 years ago

Hi! There's a little bug with 'colors' plugin which makes the whole editor crash. in trumbowyg.colors.js on line 110. It crashes when trying to call indexOf colorList. There is actually no colorList property but foreColorList and backColorList instead. So you just need to replace this code: if (trumbowyg.o.plugins.colors.colorList.indexOf(foreColor) >= 0) { tags.push('foreColor' + foreColor); } else { tags.push('foreColorFree'); }

with this: if (trumbowyg.o.plugins.colors.foreColorList.indexOf(foreColor) >= 0) { tags.push('foreColor' + foreColor); } else { tags.push('foreColorFree');

and this: if (trumbowyg.o.plugins.colors.colorList.indexOf(backColor) >= 0) { tags.push('backColor' + backColor); } else { tags.push('backColorFree'); }

with this: if (trumbowyg.o.plugins.colors.backColorList.indexOf(backColor) >= 0) { tags.push('backColor' + backColor); } else { tags.push('backColorFree'); }

cheers

Cholo981 commented 3 years ago

Thanks, I was about to drop the plugin.