brstuff / ckawesome

CKAwesome is a Font Awesome plugin for CKEditor.
http://io.brstuff.com/ckawesome/
GNU General Public License v3.0
4 stars 6 forks source link

Update select2 #1

Open xim opened 7 years ago

xim commented 7 years ago

My page uses a more recent version of select2, and I can't get CKAwesome to work with the new version. Could you update to select2 3.5.2?

sebastiansulinski commented 6 years ago

I was having a problem with plugin not being able to find jQuery so I added it manually from within plugin.js

CKEDITOR.scriptLoader.load(CKEDITOR.plugins.getPath('ckawesome') + 'resources/jquery-3.2.1.min.js');
CKEDITOR.scriptLoader.load(CKEDITOR.plugins.getPath('ckawesome') + 'resources/select2/select2.full.min.js');

but what I think would be useful, and what could resolve all those dependency issues is to check if the given resource is already available in the global scope first, then check if CKEDITOR config has an entry for it - perhaps you'd like to load the version that you already use and as a fallback load the one that comes with ckawesome. This could give a bit more flexibility, but of course, if there were any incompatibilities in the version of the code you load then that could shout out eventually.

lanecwheeler commented 5 years ago

To anyone in the future, if you're here because your select box has no width, for me there was a class that was adding a position: absolute; to the box which was borking things for me. I also took off a weird margin-right while I was at it...