Skip to content

Instantly share code, notes, and snippets.

@BrightnBubbly
Created May 29, 2018 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrightnBubbly/1e87bb13210213218cee92c869d2b0f8 to your computer and use it in GitHub Desktop.
Save BrightnBubbly/1e87bb13210213218cee92c869d2b0f8 to your computer and use it in GitHub Desktop.
(function(window) {
'use strict';
/**
* @constructor
*/
function ProactiveController(main) {
this.main = main;
this.helpers = this.helpers || new window.chat_custom_design.Helpers(this.options, this.target);
}
ProactiveController.prototype = {
visitorClearsProactive: function() {
//remove timer & reset since user dismissed
SnapEngage.clearProactiveChatAutocloseTimeout();
SnapEngageChat.setNoProactiveChatCookie();
},
finishProactiveTimeout: function() {
// Because this is called from within animate object, we need to provide a reference to app.js again
this.app = SnapEngage.getCustomDesignUI();
// Remove proactive message from visitor view (refresh the app)
this.app.refresh();
//stop the mew message flashing in the browser tab
this.main.setVisitorNotification(false);
// Remove proactive message from chat transcript history
SnapEngageChat.reInit();
},
};
window.chat_custom_design = window.chat_custom_design || {};
window.chat_custom_design.ProactiveController = ProactiveController;
})(window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment