From 364efe4ea52bcf8e59bbb8b33ba65c96fa2f9a03 Mon Sep 17 00:00:00 2001 From: juanf <juanf> Date: Tue, 28 Apr 2015 09:14:54 +0000 Subject: [PATCH] SSDM-1724 : Plate View (ongoing work) SVN: 33917 --- .../eln-lims/html/js/util/PrintUtil.js | 20 +++++++++++++++---- .../html/js/views/legacy/SampleHierarchy.js | 19 ++++++++++-------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js index 69d65a31dc4..c4b658f2473 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/PrintUtil.js @@ -71,13 +71,13 @@ var PrintUtil = new function() { return allParentCodesAsText; } - this.getTable = function(entity, showClose, withColors, withLinks, optionalTitle, isCondensed, customClass) { + this.getTable = function(entity, showClose, withColors, withLinks, optionalTitle, isCondensed, customClass, extraCustomId, extraContent) { var defaultColor = null; if(!withColors) { defaultColor = "transparent" } else { - defaultColor = profile.getColorForInspectors(entity.sampleTypeCode); + defaultColor = "#FBFBFB"; } var inspector = ""; @@ -238,8 +238,16 @@ var PrintUtil = new function() { inspector += "</table>" - var extraContainerId = entity.sampleTypeCode + "_" + entity.code+"_INSPECTOR_EXTRA"; - inspector += "<div class='inspectorExtra' id='"+ extraContainerId + "'></div>"; + var extraContainerId = null; + var extraHTML = null; + if(extraContent && extraCustomId) { + extraContainerId = extraCustomId; + extraHTML = extraContent; + } else { + extraContainerId = this.getExtraContainerId(entity); + extraHTML = ""; + } + inspector += "<div class='inspectorExtra' id='"+ extraContainerId + "'>" + extraHTML + "</div>"; profile.inspectorContentExtra(extraContainerId, entity); inspector += "</div>" @@ -247,4 +255,8 @@ var PrintUtil = new function() { return inspector; } + + this.getExtraContainerId = function(entity) { + return "INSPECTOR_EXTRA_" + entity.permId; + } } \ No newline at end of file diff --git a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/legacy/SampleHierarchy.js b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/legacy/SampleHierarchy.js index 8b76324c6f0..bc6b8310186 100644 --- a/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/legacy/SampleHierarchy.js +++ b/plasmid/source/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/legacy/SampleHierarchy.js @@ -321,14 +321,9 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { if(sample.showDataOnGraph) { var title = $nodeContent[0].outerHTML; - var $graphTable = PrintUtil.getTable(sample, false, true, false, title, true); - - $nodeContent.empty(); - $nodeContent.css({ - 'background-color' : 'transparent' - }); - $nodeContent.append($graphTable); + var extraCustomId = null; + var extraContent = null; if(sample.sampleTypeCode === "PLATE") { var plateController = new PlateController(sample); @@ -339,9 +334,17 @@ function SampleHierarchy(serverFacade, containerId, profile, sample) { } //Normal plate draw using place holder for the svg graph size calculations - $nodeContent.append(plateController.getPlaceHolder()); + extraContent = plateController.getPlaceHolder(); + extraCustomId = plateController.getPlaceHolderId(); plateController.initWithPlaceHolder(); } + var $graphTable = PrintUtil.getTable(sample, false, true, false, title, true, null, extraCustomId, extraContent); + + $nodeContent.empty(); + $nodeContent.css({ + 'background-color' : 'transparent' + }); + $nodeContent.append($graphTable); } } else { -- GitLab