fixed problem with same id instead of previewId
This commit is contained in:
parent
74e77f7492
commit
0dcaeb81d6
2 changed files with 5 additions and 14 deletions
|
|
@ -302,15 +302,6 @@ $(function(){
|
|||
self.abortFreeTransforms();
|
||||
snap.selectAll('#'+file.previewId).remove();
|
||||
self.placedDesigns.remove(file);
|
||||
// TODO debug why remove always clears all items of this type.
|
||||
// self.placedDesigns.remove(function(item){
|
||||
// console.log("item", item.previewId );
|
||||
// //return false;
|
||||
// if(item.previewId === file.previewId){
|
||||
// console.log("match", item.previewId );
|
||||
// return true;
|
||||
// } else return false;
|
||||
// });
|
||||
};
|
||||
self.fitSVG = function(file){
|
||||
self.abortFreeTransforms();
|
||||
|
|
@ -345,10 +336,10 @@ $(function(){
|
|||
var vertical = self.px2mm((bbox.y2 - bbox.y) * globalScale);
|
||||
var id = svg.attr('id');
|
||||
var label_id = id.substr(0, id.indexOf('-'));
|
||||
$('#'+label_id+' .translation').text(tx.toFixed(1) + ',' + ty.toFixed(1));
|
||||
$('#'+label_id+' .horizontal').text(horizontal.toFixed() + 'mm');
|
||||
$('#'+label_id+' .vertical').text(vertical.toFixed() + 'mm');
|
||||
$('#'+label_id+' .rotation').text(rot.toFixed(1) + '°');
|
||||
$('#'+id+' .translation').text(tx.toFixed(1) + ',' + ty.toFixed(1));
|
||||
$('#'+id+' .horizontal').text(horizontal.toFixed() + 'mm');
|
||||
$('#'+id+' .vertical').text(vertical.toFixed() + 'mm');
|
||||
$('#'+id+' .rotation').text(rot.toFixed(1) + '°');
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@
|
|||
<div class="accordion-body collapse in overflow_visible" id="wa_filelist">
|
||||
<div class="accordion-inner">
|
||||
<div class="gcode_files" data-bind="slimScrolledForeach: placedDesigns">
|
||||
<div class="entry" data-bind="attr: { id: $data.id }, template: { name: $root.templateFor($data), data: $data }"></div>
|
||||
<div class="entry" data-bind="attr: { id: $data.previewId }, template: { name: $root.templateFor($data), data: $data }"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="wa_template_machinecode">
|
||||
|
|
|
|||
Loading…
Reference in a new issue