Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions cortex/webgl/resources/css/mriview.css
Original file line number Diff line number Diff line change
Expand Up @@ -116,25 +116,10 @@ a:visited { color:white; }
margin:20px;
border-radius:10px;
background:rgba(255,255,255,.2);
max-width:400px;
width:max-content;
min-width:200px;
max-width:90vw;
display:none;
/*width:320px;
height:58px;
*/
transition:all .3s;
transition-timing-function:ease;
transition-delay:1s;
-moz-transition: all .3s;
-moz-transition-timing-function: ease;
-moz-transition-delay:1s;
-webkit-transition: all .3s;
-webkit-transition-timing-function: ease;
-webkit-transition-delay:1s;
}
#dataopts:hover, #dataopts:active {
transition-delay:.1s;
-moz-transition-delay:.1s;
-webkit-transition-delay:.1s;
}
#dataname {
color:white;
Expand Down Expand Up @@ -486,12 +471,14 @@ input.vlim {

/* datasets */
ul#datasets {
max-width: 400px;
list-style: none;
margin: 0;
padding: 0;
overflow:auto;
overflow-y: auto;
Comment thread
mvdoc marked this conversation as resolved.
overflow-x: hidden;
max-height:70vh;
width: max-content;
max-width: 100%;
}
ul#datasets li {
background: white;
Expand All @@ -501,6 +488,9 @@ ul#datasets li {
border: 1px solid black;
list-style: none;
padding-left: 42px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
Comment thread
mvdoc marked this conversation as resolved.
ul#datasets li .handle {
background: #CCC;
Expand Down
15 changes: 14 additions & 1 deletion cortex/webgl/resources/js/mriview.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@ var mriview = (function(module) {
this.setData(data[0].name);
};

module.Viewer.prototype.fitDataname = function() {
var dn = document.getElementById("dataname");
if (!dn || !dn.offsetWidth) return;
dn.style.fontSize = "";
var available = Math.floor(window.innerWidth * 0.9) - 60;
var width = dn.scrollWidth;
if (width <= available) return;
var maxPx = 32, minPx = 14;
var fitted = Math.max(minPx, Math.floor(maxPx * available / width));
dn.style.fontSize = fitted + "px";
};

module.Viewer.prototype.setData = function(name) {

// blur any selected input elements
Expand Down Expand Up @@ -590,6 +602,7 @@ var mriview = (function(module) {
$("#dataname").text(name);
$("#dataopts").show();
}
this.fitDataname();
this.schedule();
this.loaded.resolve();

Expand Down Expand Up @@ -1000,7 +1013,7 @@ var mriview = (function(module) {
var _bound = false;
module.Viewer.prototype._bindUI = function() {
$(window).scrollTop(0);
$(window).resize(function() { this.resize(); }.bind(this));
$(window).resize(function() { this.resize(); this.fitDataname(); }.bind(this));
this.canvas.resize(function() { this.resize(); }.bind(this));

var cam_ui = this.ui.addFolder("camera", true);
Expand Down