Implement toggle method for iframe-based chat popup

This commit is contained in:
Fedor A. Fetisov 2016-12-27 19:02:39 +03:00 committed by root autocommit
parent bc16b7c25f
commit d0f1c50f51

View File

@ -304,6 +304,12 @@ var Mibew = Mibew || {};
*/
this.isOpened = false;
/**
* Indicates if the popup is minified.
* @type {Boolean}
*/
this.isMinified = false;
// Load default styles. These styles hide the popup while real styles
// are loading.
this.attachDefaultStyles();
@ -403,6 +409,14 @@ var Mibew = Mibew || {};
Mibew.Utils.deleteCookie('mibew-chat-frame-' + this.id);
};
/**
* Toggles the popup.
*/
Mibew.ChatPopup.IFrame.prototype.toggle = function() {
this.iframe.style.display = this.isMinified ? "block" : "none";
this.isMinified = !this.isMinified;
};
/**
* Constructs Window popup.
*