Skip to content

Commit

Permalink
1.0.3rc2
Browse files Browse the repository at this point in the history
add hr after image in state panel if scale is 100%, #113
  • Loading branch information
jneilliii committed Jul 8, 2023
1 parent a675959 commit 99f2bda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"){
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -157,11 +158,13 @@ $(function() {
$('#prusaslicer_state_thumbnail').attr('src', file_data.thumbnail);
} else {
$('#state > div > hr:first').after('<img id="prusaslicer_state_thumbnail" class="pull-left" src="'+file_data.thumbnail+'" 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').removeClass('pull-left').after('<hr>');
}
if(self.settingsViewModel.settings.plugins.prusaslicerthumbnails.relocate_progress()) {
$('#state > div > div.progress.progress-text-centered').css({'margin-bottom': 'inherit'}).insertBefore('#prusaslicer_state_thumbnail').after('<hr>');
}
}
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('<hr>');
self.progress_bar_moved = true;
}
} else {
$('#prusaslicer_state_thumbnail').remove();
}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99f2bda

Please sign in to comment.