1
Customize live chat link
Question asked by Mårten Wahlund - January 13, 2015 at 6:55 AM
Answered
How can i customize the generated live chat link script? I just changed to the deferred type since we sometimes get timeouts that hang the website rendering. 
However now the chatlink is just rendered as a href with target=_blank when it was previously a nice javascript window.open that opended a smaller popup window.
Can i change this template in some way?

1 Reply

Reply to Thread
1
Mårten Wahlund Replied
January 15, 2015 at 6:25 AM
If it helps anyone else I solved this in my project by rewriting the link when added
 
(function () {
            var configId = '1';
            var controlId = 'c1';
            $('#stlivechat' + configId).bind("DOMNodeInserted", function (event) {
                var chatLink = $(event.target);
                var onLinkImg = $('#img' + controlId + 'on', chatLink);
                if (onLinkImg) {
                    chatLink.click(function () {
                        var newWindow = window.open(chatLink.attr('href'), 'LiveChat1', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=560,height=520');
                        if (newWindow) {
                            newWindow.focus(); newWindow.opener = window;
                        }
                        return false;
                    });
                }
            });
        })();
 

Reply to Thread