Created
May 29, 2018 21:44
-
-
Save BrightnBubbly/1e87bb13210213218cee92c869d2b0f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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