Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.init = function(ev, data) {
// Empty the space
var that = this;
var boxes = that.attr.storage.all();
that.$node.empty();
async.forEach(
boxes,
function(box, callback) {
// add the box Skeleton
that._addBoxSkeleton(box);
// callback for the next one
callback();
},
function(error) {
if (error) {
that._error(error);
}
// Trigger render boxes to normal mode
that.trigger(document, 'personal.boxes.ui.normal', {
ids: _.pluck(boxes, 'id')
});
that.trigger(document, 'personal.boxes.ui.initizalized');
this.processView = function(target, args, state) {
var that = this;
var isElement = _.isElement(target);
var ids = isElement ? [that._getIDFromTarget(target)] : args.ids;
async.forEach(ids, function(id, callback) {
that._processBox(id, state);
callback();
}, function(error) {
if (error) {
that._error(error);
}
});
};