"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "f902c5d4ca3930205e3ac6206eac6f9b258beb01"
Commit 53a22e1a authored by pksebben's avatar pksebben
Browse files

add increment-wrap as option to ValueControlWidget when isCombo, which loops...

add increment-wrap as option to ValueControlWidget when isCombo, which loops back to 0 when at end of list
parent c5a369a3
...@@ -81,6 +81,9 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando ...@@ -81,6 +81,9 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando
const isCombo = targetWidget.type === "combo"; const isCombo = targetWidget.type === "combo";
let comboFilter; let comboFilter;
if (isCombo) {
valueControl.options.values.push("increment-wrap");
}
if (isCombo && options.addFilterList !== false) { if (isCombo && options.addFilterList !== false) {
comboFilter = node.addWidget( comboFilter = node.addWidget(
"string", "string",
...@@ -128,6 +131,12 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando ...@@ -128,6 +131,12 @@ export function addValueControlWidgets(node, targetWidget, defaultValue = "rando
case "increment": case "increment":
current_index += 1; current_index += 1;
break; break;
case "increment-wrap":
current_index += 1;
if ( current_index >= current_length ) {
current_index = 0;
}
break;
case "decrement": case "decrement":
current_index -= 1; current_index -= 1;
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment