Skip to content

Commit 3bef693

Browse files
committed
changed split-test
1 parent 095a152 commit 3bef693

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed

dist/breinify-assets.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@
237237

238238
_handleMappedResource: function ($el, callback) {
239239
const _self = this;
240-
callback = $.isFunction(callback) ? callback : function () {
241-
};
240+
callback = $.isFunction(callback) ? callback : this._createCallback();
242241

243242
// make sure we have a valid mapId, otherwise there is nothing to do
244243
let mapId = $el.attr('data-mapId');
@@ -285,8 +284,7 @@
285284

286285
_renderMappedResource: function ($el, type, mapId, callback) {
287286
const _self = this;
288-
callback = $.isFunction(callback) ? callback : function () {
289-
};
287+
callback = $.isFunction(callback) ? callback : this._createCallback();
290288

291289
if (typeof type !== 'string' || type.trim() === '') {
292290
callback(new Error('invalid type: ' + type));
@@ -381,7 +379,7 @@
381379
}
382380
},
383381

384-
_setUpElement: function($el, $newEl, resourceId, data, callback) {
382+
_setUpElement: function ($el, $newEl, resourceId, data, callback) {
385383
const _self = this;
386384

387385
// apply some default attributes
@@ -500,6 +498,18 @@
500498
}
501499
},
502500

501+
_createCallback: function () {
502+
return function (error, data) {
503+
if (!Breinify.UTL.internal.isDevMode()) {
504+
return;
505+
} else if (error === null) {
506+
console.log('[Breinify] utilizing following data to render mapped resource', data);
507+
} else {
508+
console.error('[Breinify] failed to utilize mapped resource', error);
509+
}
510+
}
511+
},
512+
503513
areDataTagsEnabled: function (data, group, item) {
504514

505515
// check if data is even present

0 commit comments

Comments
 (0)