Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
template.find('.failover-number').on('click', function() {
// We add this at the moment of the event because in some cases, we bind the events before it's adding to a parent,
// which means the account-section might not be loaded yet if we bound it before the event happened.
if ($(this).parents('.account-section').length) {
args.accountId = template.parents('.account-section').data('id');
}
monster.pub('common.failover.renderPopup', args);
});
callback: function() {
if (toggle) {
/* when all the badges have been updated, display my account */
if (!--countBadges) {
monster.pub('core.showAppName', 'myaccount');
self.toggle({
callback: callback
});
}
}
}
});
parent.find('.category#numbers').on('click', function() {
monster.pub('voip.numbers.render', container);
});
_errorTrackerRenderContent: function(args) {
var self = this,
dataTemplate = self.errorTrackerFormatData(monster.logs.error),
listErrorTemplates = $(self.getTemplate({
name: 'layout',
data: dataTemplate,
submodule: 'errorTracker'
}));
self.errorTrackerBindEvents(listErrorTemplates);
monster.pub('myaccount.renderSubmodule', listErrorTemplates);
args.callback && args.callback(listErrorTemplates);
},
}, function(err, results) {
var formattedData = self.userLayoutFormatData(results),
userTemplate = $(self.getTemplate({
name: 'layout',
data: formattedData,
submodule: 'user'
}));
self.userBindingEvents(userTemplate, results);
monster.pub('myaccount.renderSubmodule', userTemplate);
if (typeof args.callback === 'function') {
args.callback(userTemplate);
}
});
},
self.balanceDisplayGenericTable('per-minute-voip', balance, renderData.uiRestrictions.balance.show_credit, function() {
monster.pub('myaccount.updateMenu', args);
monster.pub('myaccount.renderSubmodule', balance);
if (typeof argsCallback === 'function') {
argsCallback(balance);
}
});
}
self.profileFormatData(results, function(results) {
var profile = $(monster.template(self, 'profile-layout', results));
self.profileBindEvents(profile, results);
monster.pub('myaccount.renderSubmodule', profile);
if(args.uiTab) {
profile.find('a[href="#'+args.uiTab+'"]').tab('show');
}
if(typeof args.callback === 'function') {
args.callback(profile);
}
});
}
self.usersListConferences(userId, function(conferences) {
var listRequests = [];
_.each(conferences, function(conference) {
listRequests.push(function(subCallback) {
self.usersDeleteConference(conference.id, function(data) {
subCallback(null, data);
});
});
});
monster.parallel(listRequests, function(err, results) {
callback && callback(results);
});
});
},
loadDependencies: function(app, globalCallback) {
var self = this,
listRequests = {},
externalPath = app.appPath + '/external/',
deps = app.externalScripts || [];
if(deps.length > 0) {
_.each(deps, function(name) {
listRequests[name] = function(callback) {
monster.getScript(externalPath + name + '.js', function() {
callback(null, {});
});
}
});
monster.parallel(listRequests, function(err, results) {
globalCallback && globalCallback();
});
}
else {
globalCallback && globalCallback();
}
},
if('pattern' in featureCode) {
callflow.patterns = [ featureCode.pattern ];
}
else {
callflow.numbers = [ featureCode.callflowNumber ];
}
listRequests.push(function(localCallback) {
self.strategyCreateCallflow(callflow, function(data) {
localCallback && localCallback(null, data);
});
});
});
monster.parallel(listRequests, function(err, results) {
callback && callback();
});
}
});
},