diff --git a/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js b/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js index c047b4c..5b0bfff 100644 --- a/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js +++ b/octoprint_prusaslicerthumbnails/static/js/prusaslicerthumbnails.js @@ -18,7 +18,6 @@ $(function() { self.file_details = ko.observable(); self.crawling_files = ko.observable(false); self.crawl_results = ko.observableArray([]); - self.progress_bar_moved = false; self.filesViewModel.prusaslicerthumbnails_open_thumbnail = function(data) { if(data.thumbnail_src === "prusaslicerthumbnails"){ @@ -120,7 +119,9 @@ $(function() { }); self.settingsViewModel.settings.plugins.prusaslicerthumbnails.state_panel_thumbnail_scale_value.subscribe(function(newValue){ $('#prusaslicer_state_thumbnail').attr({'width': self.settingsViewModel.settings.plugins.prusaslicerthumbnails.state_panel_thumbnail_scale_value() + '%'}); - + if(self.settingsViewModel.settings.plugins.prusaslicerthumbnails.state_panel_thumbnail_scale_value() !== 100) { + $('#prusaslicer_state_thumbnail').addClass('pull-left').next('hr').remove(); + } }); // observe alignment changes @@ -157,11 +158,13 @@ $(function() { $('#prusaslicer_state_thumbnail').attr('src', file_data.thumbnail); } else { $('#state > div > hr:first').after(''); + if(self.settingsViewModel.settings.plugins.prusaslicerthumbnails.state_panel_thumbnail_scale_value() == 100) { + $('#prusaslicer_state_thumbnail').removeClass('pull-left').after('
'); + } + if(self.settingsViewModel.settings.plugins.prusaslicerthumbnails.relocate_progress()) { + $('#state > div > div.progress.progress-text-centered').css({'margin-bottom': 'inherit'}).insertBefore('#prusaslicer_state_thumbnail').after('
'); + } } - if(self.settingsViewModel.settings.plugins.prusaslicerthumbnails.relocate_progress() && !self.progress_bar_moved) { - $('#state > div > div.progress.progress-text-centered').css({'margin-bottom': 'inherit'}).insertBefore('#prusaslicer_state_thumbnail').after('
'); - self.progress_bar_moved = true; - } } else { $('#prusaslicer_state_thumbnail').remove(); } diff --git a/setup.py b/setup.py index 9324fa3..8a493af 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "Slicer Thumbnails" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.0.3rc1" +plugin_version = "1.0.3rc2" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module