mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 11:02:08 +00:00
Filament Selection dialog Fixes / Improvements (#12325)
* Update 22.js * fix printer list empty * switch to vertical scrolling on custom filaments * Update 23.css * add stats * fix uncommon filament types * fix setup wizerd styling --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -74,10 +74,10 @@ function SortUI()
|
||||
|
||||
$('#MachineList .CValues').append(HtmlMode);
|
||||
$('#MachineList .CValues input').prop("checked",true);
|
||||
if(nMode<=1)
|
||||
{
|
||||
$('#MachineList').hide();
|
||||
}
|
||||
//if(nMode<=1)
|
||||
//{
|
||||
// $('#MachineList').hide();
|
||||
//}
|
||||
|
||||
//Filament - Create sorted array with generic vendor first
|
||||
let FilamentArray=new Array();
|
||||
@@ -171,7 +171,7 @@ function SortUI()
|
||||
if(pFila.length==0)
|
||||
{
|
||||
/* ORCA use label tag to allow checkbox to toggle when user ckicked to text */
|
||||
let HtmlFila='<label class="MItem"><input type="checkbox" vendor="'+fVendor+'" filatype="'+fType+'" filalist="'+fWholeName+';'+'" model="'+fModel+'" name="'+fShortName+'" /><span>'+fShortName+'</span></label>';
|
||||
let HtmlFila='<label class="MItem"><input type="checkbox" onChange="UpdateStats()" vendor="'+fVendor+'" filatype="'+fType+'" filalist="'+fWholeName+';'+'" model="'+fModel+'" name="'+fShortName+'" /><span>'+fShortName+'</span></label>';
|
||||
|
||||
$("#ItemBlockArea").append(HtmlFila);
|
||||
}
|
||||
@@ -238,6 +238,8 @@ function SortUI()
|
||||
//------
|
||||
if(SelectNumber==0)
|
||||
ChooseDefaultFilament();
|
||||
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
|
||||
@@ -403,9 +405,29 @@ function SortFilament()
|
||||
else
|
||||
$(OneNode).hide();
|
||||
}
|
||||
else
|
||||
else{
|
||||
$(OneNode).hide();
|
||||
//alert(fName) //debug non common filament type
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
function UpdateStats()
|
||||
{
|
||||
let $i = $("#ItemBlockArea");
|
||||
let $allItems = $i.find(".MItem");
|
||||
let $visibleItems = $i.find(".MItem:visible");
|
||||
let $filteredItems = $visibleItems.filter(function() { return $(this).css('position') !== 'absolute'});
|
||||
let visibleCount = Math.min($filteredItems.length, $visibleItems.length);
|
||||
|
||||
$(".list-item-count").text(
|
||||
$i.find("input:checked").length + " / " +
|
||||
$allItems.length +
|
||||
($allItems.length > visibleCount ? (" [" + visibleCount + "]") : "") // filtered items
|
||||
);
|
||||
}
|
||||
|
||||
function ChooseDefaultFilament()
|
||||
@@ -461,6 +483,8 @@ function SelectAllFilament( nShow )
|
||||
else {
|
||||
$('#ItemBlockArea .MItem:visible input').prop("checked",nShow!=0);
|
||||
}
|
||||
|
||||
UpdateStats();
|
||||
}
|
||||
|
||||
function ShowNotice( nShow )
|
||||
|
||||
Reference in New Issue
Block a user