Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
preLoad: function (params) {
// check if it is the logs level with history activated and if so - replace original log-for- id
if (params.data['log.state.history']) {
params.data['filter.eq.item'] = params.data['log.state.history'];
}
if (!this.logPanel) {
this.$infoHolder.off().empty();
this.logPanel = new Log.LogPanel({
navigationInfo: this.navigationInfo,
element: this.$infoHolder,
user: config.userModel,
project: config.project
}).render();
}
},
preLoad: function (params) {
// check if it is the logs level with history activated and if so - replace original log-for- id
if (params.data['log.state.history']) {
params.data['filter.eq.item'] = params.data['log.state.history'];
}
if (!this.logPanel) {
this.$infoHolder.off().empty();
this.logPanel = new Log.LogPanel({
navigationInfo: this.navigationInfo,
element: this.$infoHolder,
user: config.userModel,
project: config.project
}).render();
}
},
update: function (collection) {
// check for images any time collection is reloaded
this.parseCollectionForImages(collection);
var data = this.navigationInfo.getRequestData(),
filter = data['log.state.history'];
this.historyFilter.set('value', filter);
this.clearFilters(data);
if (this.initDone) {
var incomingLog = this.navigationInfo.last().get('data').id;
if (this.$currentLogId === incomingLog) {
var target = filter ? $("[data-id='" + filter + "']", this.historyWell) : $(".progress-bar:last", this.historyWell);
this.setupActiveHistoryByElement(target);
if(this.getCurrentHistoryItem()){
this.reLoadDefect();
}
// do nothing with gallery since it listens to grid::loaded event eny way
} else {
// weird case when somebody inserts url with another log id
this.$currentLogId = incomingLog;
this.validateForHistory();
}
restoreHistoryFilter: function () {
var data = this.navigationInfo.getRequestData(),
filter = data['log.state.history'] || null;
this.historyFilter.set('value', filter);
},