mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 02:41:17 +00:00
Change some search actions and results text. Force repaint for when resizing and show happens
This commit is contained in:
@@ -390,7 +390,7 @@ function favDigitFromEvent(e) {
|
||||
|
||||
function resultCountText(total, shown, query) {
|
||||
return (query || "").trim() ?
|
||||
T("sd_result_count", "Showing %s of %s actions", shown, total) :
|
||||
T("sd_result_count", "Showing %s actions", shown) :
|
||||
T("sd_result_count_all", "%s actions", total);
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ window.HandleStudio = function (payload) {
|
||||
builtKey = "";
|
||||
if (qEl) {
|
||||
qEl.value = "";
|
||||
qEl.placeholder = T("sd_search_n", "Search %s actions", ACTIONS.length);
|
||||
qEl.placeholder = T("sd_search", "Search actions");
|
||||
syncClearButton();
|
||||
}
|
||||
render({ resize: true, resetScroll: true });
|
||||
@@ -1376,7 +1376,7 @@ function exitPhase() {
|
||||
// It survives a second-phase exit (which never goes through exitPhase from the commands view),
|
||||
// so without a reset the cached empty-query key would skip the rebuild and leave stale content.
|
||||
builtKey = "";
|
||||
qEl.placeholder = T("sd_search_n", "Search %s actions", ACTIONS.length);
|
||||
qEl.placeholder = T("sd_search", "Search actions");
|
||||
render({ resize: true, resetScroll: true });
|
||||
qEl.focus();
|
||||
}
|
||||
|
||||
@@ -436,4 +436,9 @@ assert.equal(ctx.stateFromPayload({}).tooltipExpanded, true, "expansion defaults
|
||||
assert.equal(ctx.stateFromPayload({ tooltip_expanded: false }).tooltipExpanded, false, "a collapsed payload is honored");
|
||||
assert.equal(ctx.stateFromPayload({ tooltip_expanded: true }).tooltipExpanded, true, "an expanded payload is honored");
|
||||
|
||||
// resultCountText: a search counts the shown matches only ("Showing N actions"); the total is used
|
||||
// solely for the empty-query count.
|
||||
assert.equal(ctx.resultCountText(100, 3, "lay"), "Showing 3 actions", "a search reports the shown match count only");
|
||||
assert.equal(ctx.resultCountText(100, 100, ""), "100 actions", "an empty query reports the total");
|
||||
|
||||
console.log("ok");
|
||||
|
||||
Reference in New Issue
Block a user