diff --git a/src/octoprint/plugins/svgtogcode/static/js/working_area.js b/src/octoprint/plugins/svgtogcode/static/js/working_area.js index 22fd5848..c5a585d8 100644 --- a/src/octoprint/plugins/svgtogcode/static/js/working_area.js +++ b/src/octoprint/plugins/svgtogcode/static/js/working_area.js @@ -140,6 +140,15 @@ $(function(){ self.mm2svgUnits = function(val){ return val * self.svgDPI()/25.4; }; + + self.isPlaced = function(file){ + if(file === undefined) return false; + + var filePlaced = ko.utils.arrayFirst(this.placedDesigns(), function(d) { + return d.name === file.name; + }); + return filePlaced; + }; self.placeGcode = function(file){ var previewId = self.getEntryId(file); diff --git a/src/octoprint/plugins/svgtogcode/templates/override_index.jinja2 b/src/octoprint/plugins/svgtogcode/templates/override_index.jinja2 index 8b557e00..f02eec9a 100644 --- a/src/octoprint/plugins/svgtogcode/templates/override_index.jinja2 +++ b/src/octoprint/plugins/svgtogcode/templates/override_index.jinja2 @@ -382,9 +382,9 @@
@@ -397,8 +397,8 @@