diff --git a/front_end/model_concepts.js b/front_end/model_concepts.js index 136f487..884ffc4 100644 --- a/front_end/model_concepts.js +++ b/front_end/model_concepts.js @@ -114,9 +114,14 @@ function initializeSamplerNode(node) { }); saveBtn.serialize = false; - node.widgets.splice(node.widgets.indexOf(saveBtn), 1); - node.widgets.unshift(saveBtn); + saveBtn.options = saveBtn.options || {}; + saveBtn.options.serialize = false; + //node.widgets.splice(node.widgets.indexOf(saveBtn), 1); + // Do NOT unshift here. Button stays at the end so configure() can assign + // widget values by position without the button consuming index [0]. + // The unshift happens in onConfigure, after configure() has already run. applyPrimereButtonStyle(saveBtn); + node.__primereSaveBtn = saveBtn; const originalOnWidgetChanged = node.onWidgetChanged; node.onWidgetChanged = function (name, value, oldValue, widget) { @@ -132,6 +137,8 @@ function initializeSamplerNode(node) { node.conceptDisplayWidget.inputEl.readOnly = true; node.conceptDisplayWidget.inputEl.placeholder = "Runtime model type will appear here"; node.conceptDisplayWidget.serialize = false; + node.conceptDisplayWidget.options = node.conceptDisplayWidget.options || {}; + node.conceptDisplayWidget.options.serialize = false; const originalOnExecuted = node.onExecuted; node.onExecuted = function (message) {