diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridController.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridController.js index 706a56012859559b8ad9c21e8e18330c146114fd..671461b0ece32ff9774d563dfe5c2e2e55f88f8f 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridController.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridController.js @@ -14,8 +14,8 @@ * limitations under the License. */ -function GridController() { - this._gridModel = new GridModel(); +function GridController(isSelectMultiple) { + this._gridModel = new GridModel(isSelectMultiple); this._gridView = new GridView(this._gridModel); this.init = function($container) { diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridModel.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridModel.js index 549d25377954678f7375791b48a9bbedfc24f4de..62c110c101fe6c8c7a7ed574394b6f601691d616 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridModel.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridModel.js @@ -14,8 +14,12 @@ * limitations under the License. */ -function GridModel() { +function GridModel(isSelectMultiple) { this.isDisabled = false; + this.isSelectMultiple = false; + if(isSelectMultiple) { + this.isSelectMultiple = true; + } this.numRows = null; this.numColumns = null; this.labels = null; diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridView.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridView.js index 4955e67571765bb21e130652decbe42a81d030b6..97df155da5ee9733f25ee790c925d17f95782924 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridView.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/StorageManager/widgets/GridView.js @@ -105,11 +105,21 @@ function GridView(gridModel) { this._selectPosition = function(posX, posY, label) { //To give user feedback so he knows what he have selected if(this._gridTable && posX > 0 && posY > 0) {//API only available if the table is loaded and 0 positions are labels that can't be selected - this._gridTable.find("td").removeClass("rackSelected"); + if(!this._gridModel.isSelectMultiple) { + this._gridTable.find("td").removeClass("rackSelected"); + } + var rows = this._gridTable.find("tr"); var columns = $(rows[posX]).find("td"); var cell = $(columns[posY-1]); //-1 because the th tag is skipped by the selector - cell.addClass("rackSelected"); + var cellClasses = cell.attr("class"); + + if(this._gridModel.isSelectMultiple && cellClasses && cellClasses.indexOf("rackSelected") !== -1) { + cell.removeClass("rackSelected"); + } else { + cell.addClass("rackSelected"); + } + } }