Loading grunt/task/test.js +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ module.exports = function(grunt) { grunt.config('shell.test-functional-local-parallel', { command: function() { var serverUrlParam = grunt.option('server-url'), var serverUrlParam = grunt.option('server-url') || 'http://redmic.local', userParam = grunt.option('user'), passParam = grunt.option('pass'), serverPort = 9000, Loading public/javascript/redmic/modules/browser/ListImpl.js +57 −28 Original line number Diff line number Diff line Loading @@ -24,20 +24,46 @@ define([ _addData: function(response) { var rowsOld = this._rows, data = response.data; this._clearRowsData(); this._proccesNewData(response); this._clearOldRowsData(); }, _clearRowsData: function(response) { this._rowsOld = this._rows; this._rows = {}; }, _clearOldRowsData: function() { for (var key in this._rowsOld) { this._removeRowInstance(this._rowsOld[key].instance); } delete this._rowsOld; }, _proccesNewData: function(response) { var data = response.data; if (data.data) { data = data.data; } this._rows = {}; for (var i = 0; i < data.length; i++) { this._rescueOldInstance(data[i]); this._addItem(data[i]); } }, _rescueOldInstance: function(item) { var item = data[i], idProperty = item[this.idProperty]; row = rowsOld[idProperty]; var idProperty = item[this.idProperty], row = this._rowsOld[idProperty], rowInstance = row && row.instance; if (rowInstance) { Loading @@ -46,25 +72,34 @@ define([ data: item }); delete rowsOld[idProperty]; if (this._rowsOld) { delete this._rowsOld[idProperty]; } this._addItem(item); } for (var key in rowsOld) { this._removeRowInstance(rowsOld[key].instance); } }, _addItem: function(item) { var idProperty = item[this.idProperty], rowInstance = this._getRowInstance(idProperty), rowInstance = this._addOrUpdateRow(item), obj = { node: this.rowsContainerNode }; obj.data = this._getRowData(idProperty); if (this.insertInFront) { obj.inFront = true; } rowInstance && this._publish(rowInstance.getChannel('SHOW'), obj); }, _addOrUpdateRow: function(item) { var idProperty = item[this.idProperty], rowInstance = this._getRowInstance(idProperty); if (!rowInstance) { this._addRow(idProperty, item); rowInstance = this._getRowInstance(idProperty); Loading @@ -76,13 +111,7 @@ define([ }); } obj.data = this._getRowData(idProperty); if (this.insertInFront) { obj.inFront = true; } rowInstance && this._publish(rowInstance.getChannel('SHOW'), obj); return rowInstance; } }); }); Loading
grunt/task/test.js +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ module.exports = function(grunt) { grunt.config('shell.test-functional-local-parallel', { command: function() { var serverUrlParam = grunt.option('server-url'), var serverUrlParam = grunt.option('server-url') || 'http://redmic.local', userParam = grunt.option('user'), passParam = grunt.option('pass'), serverPort = 9000, Loading
public/javascript/redmic/modules/browser/ListImpl.js +57 −28 Original line number Diff line number Diff line Loading @@ -24,20 +24,46 @@ define([ _addData: function(response) { var rowsOld = this._rows, data = response.data; this._clearRowsData(); this._proccesNewData(response); this._clearOldRowsData(); }, _clearRowsData: function(response) { this._rowsOld = this._rows; this._rows = {}; }, _clearOldRowsData: function() { for (var key in this._rowsOld) { this._removeRowInstance(this._rowsOld[key].instance); } delete this._rowsOld; }, _proccesNewData: function(response) { var data = response.data; if (data.data) { data = data.data; } this._rows = {}; for (var i = 0; i < data.length; i++) { this._rescueOldInstance(data[i]); this._addItem(data[i]); } }, _rescueOldInstance: function(item) { var item = data[i], idProperty = item[this.idProperty]; row = rowsOld[idProperty]; var idProperty = item[this.idProperty], row = this._rowsOld[idProperty], rowInstance = row && row.instance; if (rowInstance) { Loading @@ -46,25 +72,34 @@ define([ data: item }); delete rowsOld[idProperty]; if (this._rowsOld) { delete this._rowsOld[idProperty]; } this._addItem(item); } for (var key in rowsOld) { this._removeRowInstance(rowsOld[key].instance); } }, _addItem: function(item) { var idProperty = item[this.idProperty], rowInstance = this._getRowInstance(idProperty), rowInstance = this._addOrUpdateRow(item), obj = { node: this.rowsContainerNode }; obj.data = this._getRowData(idProperty); if (this.insertInFront) { obj.inFront = true; } rowInstance && this._publish(rowInstance.getChannel('SHOW'), obj); }, _addOrUpdateRow: function(item) { var idProperty = item[this.idProperty], rowInstance = this._getRowInstance(idProperty); if (!rowInstance) { this._addRow(idProperty, item); rowInstance = this._getRowInstance(idProperty); Loading @@ -76,13 +111,7 @@ define([ }); } obj.data = this._getRowData(idProperty); if (this.insertInFront) { obj.inFront = true; } rowInstance && this._publish(rowInstance.getChannel('SHOW'), obj); return rowInstance; } }); });