Mibew Messenger Community

Contributions => Plugins, tips, and tricks => Topic started by: bobscan on December 05, 2012, 07:18:52 PM

Title: Disable popup chat window focusing
Post by: bobscan on December 05, 2012, 07:18:52 PM
When there are multiple chats open and a client replies, their chat window takes focus. This can be painfully frustrating if you have multiple chat windows open and trying to respond to multiple clients.

change:
/libs/common.php (distro default line 470 )

Code: [Select]
return "<a href=\"$href\" target=\"_blank\" " . ($title ? "title=\"$title\" " : "") . "onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open($jshref, '$wndName', '$options');this.newWindow.focus();this.newWindow.opener=window;return false;\">$message</a>";

remove this bit in the line, make sure to leave only one semicolon between the remaining calls.
Code: [Select]
this.newWindow.focus();
so  it will now read:

Code: [Select]
return "<a href=\"$href\" target=\"_blank\" " . ($title ? "title=\"$title\" " : "") . "onclick=\"if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 &amp;&amp; window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open($jshref, '$wndName', '$options');this.newWindow.opener=window;return false;\">$message</a>";
Title: Re: Disable popup chat window focusing
Post by: mei on April 15, 2013, 03:41:28 PM
This is exactly what i need. But I tried it and new chat messages still steals focus from the one i'm typing in. As before, it only happens sometimes and I can't figure out when or why.. Are there other places i need to change aswell?