[REF] web: fix typos and incorrect variables
In this commit: - removed an unused event handler - fixed an overriden variable used in a subfunction - fixed a variable mismatch No bug was induced by these issues until now so it doesn't impact any behaviour. This is just an extra security for the future.
This commit is contained in:
@@ -32,7 +32,6 @@ var ListController = BasicController.extend({
|
||||
selection_changed: '_onSelectionChanged',
|
||||
toggle_column_order: '_onToggleColumnOrder',
|
||||
toggle_group: '_onToggleGroup',
|
||||
navigation_move: '_onNavigationMove',
|
||||
}),
|
||||
/**
|
||||
* @constructor
|
||||
@@ -376,11 +375,11 @@ var ListController = BasicController.extend({
|
||||
var self = this;
|
||||
var value = Object.values(changes)[0];
|
||||
var recordIds = _.union([recordId], this.selectedRecords);
|
||||
var validRecordIds = recordIds.reduce(function (result, recordId) {
|
||||
var record = self.model.get(recordId);
|
||||
var validRecordIds = recordIds.reduce(function (result, nextRecordId) {
|
||||
var record = self.model.get(nextRecordId);
|
||||
var modifiers = self.renderer._registerModifiers(node, record);
|
||||
if (!modifiers.readonly && (!modifiers.required || value)) {
|
||||
result.push(recordId);
|
||||
result.push(nextRecordId);
|
||||
}
|
||||
return result;
|
||||
}, []);
|
||||
|
||||
@@ -605,16 +605,16 @@ ListRenderer.include({
|
||||
var self = this;
|
||||
if (!this.allRecordsIds) {
|
||||
// compute the flat array of all records ids only once
|
||||
this.allRecordIds = [];
|
||||
this.allRecordsIds = [];
|
||||
utils.traverse_records(this.state, function (data) {
|
||||
self.allRecordIds.push(data.id);
|
||||
self.allRecordsIds.push(data.id);
|
||||
});
|
||||
}
|
||||
var curRecordId = this._getRecordID(this.currentRow);
|
||||
var curRecordIndex = this.allRecordIds.indexOf(curRecordId);
|
||||
var prevRecordIndex = curRecordIndex === 0 ? this.allRecordIds.length - 1 : curRecordIndex - 1;
|
||||
var curRecordIndex = this.allRecordsIds.indexOf(curRecordId);
|
||||
var prevRecordIndex = curRecordIndex === 0 ? this.allRecordsIds.length - 1 : curRecordIndex - 1;
|
||||
this.commitChanges(curRecordId).then(function () {
|
||||
var $prevRow = self._getRow(self.allRecordIds[prevRecordIndex]);
|
||||
var $prevRow = self._getRow(self.allRecordsIds[prevRecordIndex]);
|
||||
var prevRowIndex = $prevRow.prop('rowIndex') - 1;
|
||||
self._selectCell(prevRowIndex, self.columns.length - 1, {inc: -1});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user