Skip to content

Commit

Permalink
close #154
Browse files Browse the repository at this point in the history
  • Loading branch information
pbelmann committed Nov 22, 2015
1 parent 760460d commit 4b8a46b
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
13 changes: 13 additions & 0 deletions scripts/web/app/templates/css/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
body {
padding-top: 0px !important;
padding-right: 0px !important;
}

.title {
margin-top:200px;
margin-bottom:100px;
Expand Down Expand Up @@ -36,6 +41,14 @@ footer {
padding-bottom: 300px;
}

#sequences-text {
white-space: pre-wrap; /* CSS 3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

.footer-title {
padding-bottom:300px;
}
Expand Down
13 changes: 10 additions & 3 deletions scripts/web/app/templates/js/buildTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
var linkFormatter = function(value, row){
var path = window.location.href + "/../" + row['Gene ID'] + ".html";
return '<a href='+ path +'>' + value + '</a>';
}, setUpNavbar = function(){
}, seqFormatter = function(value, row, idx){
return '<button id="' + idx + '" class="btn btn-primary">Show Sequence</button>';
}, setUpNavbar = function(){

var navbar = $('#navbar-main'),
distance = navbar.offset().top,
Expand All @@ -17,7 +19,6 @@ var linkFormatter = function(value, row){
$("body").css("padding-top", "0px");
}
});

};

d3.tsv("overview_new.txt", function (error, data) {
Expand All @@ -44,6 +45,7 @@ d3.tsv("overview_new.txt", function (error, data) {
}));
}
},
currRow = "",
aggregateData = function(data) {

var aggregation = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
Expand Down Expand Up @@ -94,7 +96,7 @@ d3.tsv("overview_new.txt", function (error, data) {
} else if(val=="Subject titles") {
return "<th data-filter-control='input' class='title-col' data-field='" + val + "' data-sortable='true' >" + val + "</th>";
} else if(val=="Gene sequence"){
return "<th data-filter-control='input' class='seq-col' data-field='" + val + "' data-sortable='true' >" + val + "</th>";
return "<th data-formatter='seqFormatter' data-filter-control='input' class='seq-col' data-field='" + val + "' data-sortable='true' >" + val + "</th>";
} else {
return "<th data-filter-control='input' data-align='center' data-field='" + val + "' data-sortable='true' >" + val + "</th>";
}
Expand Down Expand Up @@ -138,6 +140,11 @@ d3.tsv("overview_new.txt", function (error, data) {
}
});

$('table').on('click','button',function(event){
currRow = data[$(event.target).attr('id')];
$('#seqModal').modal('show').find('#sequences-text').text(currRow['Gene sequence']);
});

table.bootstrapTable({data: data});

setUpNavbar();
Expand Down
16 changes: 16 additions & 0 deletions scripts/web/app/templates/modal.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div id="seqModal" class="modal fade bd-example-modal-lg">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="seqModalLabel">Sequence</h4>
</div>
<div class="modal-body">
<pre id="sequences-text"></pre>
</div>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions scripts/web/app/templates/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<div class="container-fluid">
{% include 'filter.html' %}
{% include 'table.html' %}
{% include 'modal.html' %}
</div>
{% include 'contact.html' %}
</body>
Expand Down

0 comments on commit 4b8a46b

Please sign in to comment.