Fix bug with the misbehaviour of the chat toggle

After minimizing the chat it was impossible to use it while browsing the site
This commit is contained in:
Fedor A. Fetisov 2018-04-19 22:20:38 +03:00
parent 9cb71e62c1
commit f1030c0298

View File

@ -334,11 +334,6 @@ var Mibew = Mibew || {};
// The chat was not closed so the popup should be reopened when a // The chat was not closed so the popup should be reopened when a
// new page is visited. // new page is visited.
this.safeOpen(openedChatUrl); this.safeOpen(openedChatUrl);
// Check minification status of the popup and toggle it if needed.
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
if (minifiedPopup === 'true') {
this.toggle();
}
} }
}; };
@ -428,6 +423,12 @@ var Mibew = Mibew || {};
this.toggleDiv.style.display = 'block'; this.toggleDiv.style.display = 'block';
this.iframe.src = url || this.buildChatUrl(); this.iframe.src = url || this.buildChatUrl();
this.isOpened = true; this.isOpened = true;
// Check minification status of the popup and toggle it if needed.
var minifiedPopup = Mibew.Utils.readCookie('mibew-chat-frame-minified-' + this.id);
if (minifiedPopup === 'true') {
this.toggle();
}
}; };
/** /**