• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

bb_code_edit -> click -> image overwrite

au lait

Well-known member
#1
Have a problem with xenforo -> bb_code_edit.js.

I would like to intercept clicks on images! Anyone have any idea / help how I can do this?

Standard in XF is line 456 to 467
Code:
            $ed.on('click', 'img', function(e) {
                redactorApi.focus();

                if ($(this).hasClass('mceSmilie') || $(this).hasClass('mceSmilieSprite')
                    || $(this).hasClass('attachFull') || $(this).hasClass('attachThumb')
                )
                {
                    e.preventDefault();
                    return;
                }

                var offset = 0, temp = this;
                while (temp.previousSibling)
                {
                    offset++;
                    temp = temp.previousSibling;
                }
                redactorApi.setSelection(this.parentNode, offset, this.parentNode, offset + 1);

                self.getImageModal(redactorApi);
            });
This I would like to overwrite - But no idea how!

Thank you