From 16de7384e3d6b252b82aae7b86a84b4b71d16bb1 Mon Sep 17 00:00:00 2001 From: Nathan Dunn Date: Mon, 21 Jan 2019 11:30:31 -0800 Subject: [PATCH] gotthe styling correct --- client/apollo/css/webapollo_track_styles.css | 23 ++++++++++-------- client/apollo/js/View/Track/AnnotTrack.js | 25 +++++++++++++++++--- client/apollo/json/annot.json | 2 +- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/client/apollo/css/webapollo_track_styles.css b/client/apollo/css/webapollo_track_styles.css index a85e404525..0b0933a493 100644 --- a/client/apollo/css/webapollo_track_styles.css +++ b/client/apollo/css/webapollo_track_styles.css @@ -832,27 +832,30 @@ div.track_webapollo_view_track_annotsequencetrack div.track-label .track-close-b .jbrowse .terminator { position: absolute; - height: 12px; + height: 16px; z-index: 100; - background-color: black; + /*background-color: black;*/ background-repeat: no-repeat; - background-size: 9px 11px; + background-size: 9px 15px; /* TODO: remove when we have another strand type */ background-image: url('../img/plus-terminator.png'); - background-position: bottom left; /* center image vertically */ + background-position: bottom center; /* center image vertically */ } - -.jbrowse .plus-terminator { - background-image: url('../img/plus-terminator.png'); - background-position: bottom left; /* center image vertically */ +.jbrowse .terminator-render { + position: absolute; + height: 10px; + z-index: 100; + background-color: black; } + .jbrowse .minus-terminator { - background-image: url('../img/minus-terminator.png'); - background-position: bottom right; /* center image vertically */ +} + +.jbrowse .plus-terminator { } .jbrowse .transposable_element, diff --git a/client/apollo/js/View/Track/AnnotTrack.js b/client/apollo/js/View/Track/AnnotTrack.js index 3ef03efa23..b17c991ec1 100644 --- a/client/apollo/js/View/Track/AnnotTrack.js +++ b/client/apollo/js/View/Track/AnnotTrack.js @@ -1147,6 +1147,7 @@ define([ var biotype ; // TODO: pull from the server at some point + // TODO: this list is duplicated var recognizedBioType = [ 'transcript' ,'tRNA','snRNA','snoRNA','ncRNA','rRNA','mRNA','miRNA','repeat_region','transposable_element','terminator' ]; @@ -6606,6 +6607,10 @@ define([ }, initAnnotContextMenu: function () { + + // TODO: this list is duplicated + var topTypes = ['repeat_region','transposable_element','gene','pseudogene', 'SNV', 'SNP', 'MNV', 'MNP', 'indel', 'insertion', 'deletion','terminator']; + var thisB = this; contextMenuItems = new Array(); annot_context_menu = new dijit.Menu({}); @@ -6646,7 +6651,6 @@ define([ var selected = thisB.selectionManager.getSelection(); var selectedFeature = selected[0].feature; var selectedFeatureDetails = selectedFeature.afeature; - var topTypes = ['repeat_region','transposable_element','gene','pseudogene', 'SNV', 'SNP', 'MNV', 'MNP', 'indel', 'insertion', 'deletion']; while(selectedFeature ){ if(topTypes.indexOf(selectedFeatureDetails.type.name)>=0){ thisB.getApollo().viewInAnnotationPanel(selectedFeatureDetails.name); @@ -6737,13 +6741,28 @@ define([ thisB.changeAnnotationType("miRNA"); } })); + changeAnnotationMenu.addChild(new dijitMenuItem( { + label: "terminator", + onclick: function(event) { + var selected = thisB.selectionManager.getSelection(); + var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ? + selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name; + if (selectedFeatureType != "transposable_element" && selectedFeatureType != "repeat_region") { + var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?"; + thisB.confirmChangeAnnotationType(thisB, [selected], "terminator", message); + } + else { + thisB.changeAnnotationType("terminator"); + } + } + })); changeAnnotationMenu.addChild(new dijitMenuItem( { label: "repeat_region", onClick: function(event) { var selected = thisB.selectionManager.getSelection(); var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ? selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name; - if (selectedFeatureType != "transposable_element") { + if (selectedFeatureType != "transposable_element" && selectedFeatureType != "terminator" ) { var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?"; thisB.confirmChangeAnnotationType(thisB, [selected], "repeat_region", message); } @@ -6758,7 +6777,7 @@ define([ var selected = thisB.selectionManager.getSelection(); var selectedFeatureType = selected[0].feature.afeature.type.name === "exon" ? selected[0].feature.afeature.parent_type.name : selected[0].feature.afeature.type.name; - if (selectedFeatureType != "repeat_region") { + if (selectedFeatureType != "repeat_region" && selectedFeatureType != "terminator") { var message = "Warning: You will not be able to revert back to " + selectedFeatureType + " via 'Change annotation type' menu option, use 'Undo' instead. Do you want to proceed?"; thisB.confirmChangeAnnotationType(thisB, [selected], "transposable_element", message); } diff --git a/client/apollo/json/annot.json b/client/apollo/json/annot.json index e2dae754c9..e957e7b213 100644 --- a/client/apollo/json/annot.json +++ b/client/apollo/json/annot.json @@ -24,7 +24,7 @@ "arrowheadClass" : "annot-arrowhead", "alternateClasses" : { "terminator" : { - "renderClassName" : "terminatort annot-apollo", + "renderClassName" : "terminator-render annot-apollo", "className" : "terminator" }, "transposable_element" : {