details: https://code.openbravo.com/erp/devel/pi/rev/72ee96e5a9f7 changeset: 35849:72ee96e5a9f7 user: Carlos Aristu <carlos.aristu <at> openbravo.com> date: Mon May 20 18:06:19 2019 +0200 summary: related to bug 40802: additional code improvements
- Remove useless assignment - Use single return statement - Remove checks which always evaluate to true diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js | 14 +++------ 1 files changed, 5 insertions(+), 9 deletions(-) diffs (52 lines): diff -r 2bc577948e7d -r 72ee96e5a9f7 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Mon May 20 16:11:56 2019 +0200 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js Mon May 20 18:06:19 2019 +0200 @@ -1104,7 +1104,6 @@ this.deselectAllRecords(); if (localState.summaryFunctions) { - hasSummaryFunction = false; for (i = 0; i < this.getAllFields().length; i++) { fld = this.getAllFields()[i]; // summary functions are not allowed in computed columns @@ -1496,11 +1495,8 @@ ksAction_DeleteSelectedRecords = function () { var isRecordDeleted = me.deleteSelectedRowsByToolbarIcon(); - if (isRecordDeleted) { - return false; // To avoid keyboard shortcut propagation - } else { - return true; - } + // Return false to avoid keyboard shortcut propagation + return isRecordDeleted ? false : true; }; OB.KeyboardManager.Shortcuts.set('ViewGrid_DeleteSelectedRecords', 'OBViewGrid.body', ksAction_DeleteSelectedRecords); @@ -2100,7 +2096,7 @@ getCriteria: function () { var criteria = this.Super('getCriteria', arguments) || {}; - if ((criteria === null || !criteria.criteria) && this.initialCriteria) { + if (!criteria.criteria && this.initialCriteria) { criteria = isc.shallowClone(this.initialCriteria); } criteria = this.convertCriteria(criteria); @@ -3237,7 +3233,7 @@ this.removeRecordFromValidationErrorList(record); // a new id has been computed use that now - if (record && record._newId) { + if (record._newId) { record.id = record._newId; delete record._newId; if (this.view && this.view.updateLastSelectedState) { @@ -3706,7 +3702,7 @@ record[this.recordBaseStyleProperty] = null; } - if (record && record.editColumnLayout) { + if (record.editColumnLayout) { isc.Log.logDebug('hideInlineEditor has record and editColumnLayout', 'OB'); record.editColumnLayout.showEditOpen(); } else if (this.currentEditColumnLayout) { _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits