Skip to content

Commit

Permalink
Optimize height of temperature graph and add max-height
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul de Vries committed Oct 31, 2015
1 parent 7e1049f commit 1b0cbba
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
2 changes: 1 addition & 1 deletion octoprint_touchui/static/css/touchui.css

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions octoprint_touchui/static/js/includes/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@
$.fn.TouchUI.files = {
init: function() {
var self = this;

if( !this.isTouch ) {
// Refresh body on dropdown click
$(document).on("click", ".container .dropdown-menu li a", function() {
setTimeout(function() {
self.scroll.iScrolls.body.refresh();
}, 0);
});

// Refresh body and scroll to previous element
$(document).on("click", ".container .pagination ul li a", function(e) {
setTimeout(function() {
self.scroll.iScrolls.body.refresh();
}, 0);
});
}

this.files.touchList();
},

Expand Down
18 changes: 13 additions & 5 deletions octoprint_touchui/static/js/includes/scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@

},

// Add scrolling with mousedown if there is no touch
init: function() {
var self = this;

if (this.isTouch) {
if ( this.isTouch ) {

// Covert VH to the initial height (prevent height from jumping when navigation bar hides/shows)
$("#temperature-graph").height($("#temperature-graph").outerHeight());
Expand All @@ -56,6 +55,13 @@
self.scroll.body.init.call(self);
self.scroll.modal.init.call(self);

// Refresh body on dropdown click
$(document).on("click", ".container .pagination ul li a", function() {
setTimeout(function() {
self.scroll.currentActive.refresh();
}, 0);
});

}

self.scroll.dropdown.init.call(self);
Expand Down Expand Up @@ -162,9 +168,11 @@

// Refresh current scroll
if ( !self.isTouch ) {
var translateY = parseFloat($('.page-container').css("transform").split(",")[5].replace("-",""));
$('.octoprint-container').css("min-height", $dropdownToggle.next().outerHeight() + $dropdownToggle.next().offset().top + translateY);
self.scroll.currentActive.refresh();
setTimeout(function() {
var translateY = parseFloat($('.page-container').css("transform").split(",")[5].replace("-",""));
$('.octoprint-container').css("min-height", $dropdownToggle.next().outerHeight() + $dropdownToggle.next().offset().top + translateY);
self.scroll.currentActive.refresh();
}, 0);
}

// Skip everything if we are in the main dropdown toggle dropdowns
Expand Down
5 changes: 3 additions & 2 deletions octoprint_touchui/static/less/tabs/temperature.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#temperature-graph {
position: relative;
margin-bottom: 10px;
height: 85vh;
height: 60vh;
max-height: 300px;
background-size: contain;
.box-sizing(border-box);

Expand Down Expand Up @@ -50,7 +51,7 @@
}
.row-fluid {
width: 161vw !important;
margin: 20px 0 40px 0 !important;
margin: 0 0 20px 0 !important;
transition: left 0.5s ease;
cursor: w-resize;
position: relative;
Expand Down

0 comments on commit 1b0cbba

Please sign in to comment.