1. 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

Discussion in 'XenForo Development Discussions' started by au lait, Nov 8, 2015.

  1. au lait

    au lait Well-Known Member

    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
     

Share This Page