From 84371fe961025416fc38a15f32bc9df4a356509b Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Mon, 31 Mar 2014 14:00:10 +0000 Subject: [PATCH] SSDM-18: Support initial D-BIOL Workflow - Polishing 2 SVN: 31247 --- .../html/js/widgets/SampleLinksWidget.js | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js index c7b1bb870d0..9a58a409437 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SampleLinksWidget.js @@ -35,7 +35,7 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType this.samplesToEdit = (samplesToEdit)?samplesToEdit:new Array(); //Only used to populate the widget this.samples = {}; - this._lastTableId = null; + this._lastUsedId = null; this._lastIndex = 0; this._addAny = function(id, tableId, sampleId) { @@ -66,17 +66,21 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType var sampleType = _this.profile.getTypeForTypeCode(sampleTypeCode); if(sampleType !== null) { - if(_this._lastTableId) { - $('#'+_this._lastTableId).empty(); + if(_this._lastUsedId) { + $('#'+_this._lastUsedId + "-table").empty(); + $("#"+_this._lastUsedId).css({"background-color" : "#FFFFFF" }); } var onClick = function(sample) { - $('#'+_this._lastTableId).empty(); + $('#'+_this._lastUsedId + "-table").empty(); + $("#"+_this._lastUsedId).css({"background-color" : "#FFFFFF" }); _this.removeSample(sampleId); _this.addSample(sample); + $("#" + id).css({"background-color" : "#FFFFFF" }); } + $("#" + id).css({"border-radius" : "10px", "padding" : "10px", "background-color" : "#EEEEEE" }); var sampleTable = new SampleTable(_this.serverFacade,tableId,_this.profile, sampleTypeCode, false, false, onClick, false, true); sampleTable.init(); - _this._lastTableId = tableId; + _this._lastUsedId = id; Util.unblockUI(); } }); @@ -88,9 +92,9 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType var sampleId = id + "-sample"; var labelId = id + "-label"; var $component = $("<div>", {"id" : id , "class" : "control-group", "sample-type-code" : sampleTypeHint["TYPE"]} ); - var $label = $("<label>", { "class" : "control-label", "id" : labelId}).text(sampleTypeHint["LABEL"] + ":"); - - var $controls = $("<div>", { "class" : "controls"}); + $component.css({"border-radius" : "10px", "padding" : "10px"}); + var $label = $("<label>", { "class" : "control-label", "id" : labelId}).text(sampleTypeHint["LABEL"] + ":"); + var $controls = $("<div>", { "class" : "controls"}); var $textField = $("<a>", {"class" : "btn", "type" : "button", "id" : sampleId, "disabled" : ""}); $textField.css({ @@ -121,17 +125,21 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType var sampleType = _this.profile.getTypeForTypeCode(sampleTypeCode); if(sampleType !== null) { - if(_this._lastTableId) { - $('#'+_this._lastTableId).empty(); + if(_this._lastUsedId) { + $('#'+_this._lastUsedId + "-table").empty(); + $("#"+_this._lastUsedId).css({"background-color" : "#FFFFFF" }); } var onClick = function(sample) { - $('#'+_this._lastTableId).empty(); + $('#'+_this._lastUsedId + "-table").empty(); + $("#"+_this._lastUsedId).css({"background-color" : "#FFFFFF" }); _this.removeSample(sampleId); _this.addSample(sample); + $("#" + id).css({"background-color" : "#FFFFFF" }); } + $("#" + id).css({"border-radius" : "10px", "padding" : "10px", "background-color" : "#EEEEEE" }); var sampleTable = new SampleTable(_this.serverFacade,tableId,_this.profile, sampleTypeCode, false, false, onClick, false, true); sampleTable.init(); - _this._lastTableId = tableId; + _this._lastUsedId = id; } else { _this._addAny(id, tableId, sampleId); } @@ -294,6 +302,8 @@ function SampleLinksWidget(containerId, profile, serverFacade, title, sampleType } $input.empty(); $input.append(meaningfulInfo); + } else { + Util.showError("Item Already selected, choose another."); } } -- GitLab