mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(contact) init: early return
This commit is contained in:
parent
ecaf1cba88
commit
076b2e2ae1
1 changed files with 16 additions and 15 deletions
|
|
@ -13,23 +13,24 @@ var CloudCmd, Util, DOM, olark;
|
|||
Inited = false;
|
||||
|
||||
function init(callback) {
|
||||
if (!Inited) {
|
||||
Contact.show = show;
|
||||
Contact.hide = hide;
|
||||
if (Inited)
|
||||
return;
|
||||
|
||||
Contact.show = show;
|
||||
Contact.hide = hide;
|
||||
|
||||
load(function() {
|
||||
Inited = true;
|
||||
|
||||
load(function() {
|
||||
Inited = true;
|
||||
|
||||
olark.identify('6216-545-10-4223');
|
||||
olark('api.box.onExpand', Contact.show);
|
||||
olark('api.box.onShow', Contact.show);
|
||||
olark('api.box.onShrink', Contact.hide);
|
||||
|
||||
Util.exec(callback);
|
||||
});
|
||||
olark.identify('6216-545-10-4223');
|
||||
olark('api.box.onExpand', Contact.show);
|
||||
olark('api.box.onShow', Contact.show);
|
||||
olark('api.box.onShrink', Contact.hide);
|
||||
|
||||
Events.addKey(onKey);
|
||||
}
|
||||
Util.exec(callback);
|
||||
});
|
||||
|
||||
Events.addKey(onKey);
|
||||
}
|
||||
|
||||
function load(callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue