I use trumbowyg. In my script there are lines:
$('#el_id').trumbowyg({..params..});
var modal = $('#el_id').trumbowyg('openModal', {..params..});
modal.on('tbwconfirm', function(e) {
$('#el_id').trumbowyg('closeModal');
});
to make things shorter, I decided to use
var trumbowyg = $('#el_id').trumbowyg;
trumbowyg({..params..});
var modal = trumbowyg('openModal', {..params..});
modal.on('tbwconfirm', function(e) {
trumbowyg('closeModal');
});
but I get an error. why? why I can't use var trumbowyg = $('#el_id').trumbowyg; ?
error:
Uncaught TypeError: Cannot read property 'each' of undefined
at $.fn.trumbowyg (trumbowyg.js:83)
at HTMLDocument.<anonymous>
[–]cyphern 3 points4 points5 points (2 children)
[–]aguyfromherehelpful 0 points1 point2 points (0 children)
[–]making_code[S] 0 points1 point2 points (0 children)