mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
added api into angular sixpack
This commit is contained in:
parent
f7854649e2
commit
9d3c49242d
1 changed files with 7 additions and 3 deletions
10
services/web/public/js/libs/angular-sixpack.js
vendored
10
services/web/public/js/libs/angular-sixpack.js
vendored
|
@ -119,7 +119,11 @@
|
|||
},
|
||||
// Register a 'conversion'. If no testName, will call for all active tests
|
||||
// Takes an optional callback that receives the raw response from sixpack (or undefined on error)
|
||||
convert : function (testName, callback) {
|
||||
convert : function (testName, kpi, callback) {
|
||||
if (typeof kpi === 'function') {
|
||||
callback = kpi;
|
||||
kpi = null;
|
||||
}
|
||||
var session = _getOrInitSession();
|
||||
if (!testName) {
|
||||
if (_opts.debug) {
|
||||
|
@ -128,7 +132,7 @@
|
|||
for (var i = 0, ii = _tests.length; i < ii; i++) {
|
||||
var test = _tests[i]
|
||||
, results = [];
|
||||
session.convert(test, function (err, res) {
|
||||
session.convert(test, kpi, function (err, res) {
|
||||
results.push(res);
|
||||
if (err && _opts.debug) {
|
||||
$log.warn("[sixpack] Error recording conversion for", test, err);
|
||||
|
@ -149,7 +153,7 @@
|
|||
if (_opts.debug) {
|
||||
$log.info("[sixpack] Recording conversion for", testName);
|
||||
};
|
||||
session.convert(testName, function (err, res) {
|
||||
session.convert(testName, kpi, function (err, res) {
|
||||
if (err && _opts.debug) {
|
||||
$log.warn('[sixpack] Error recording conversion:', err);
|
||||
} else if (_opts.debug) {
|
||||
|
|
Loading…
Reference in a new issue