diff --git a/lib/zin/wg/thinkmatrixoptions/js/v1.js b/lib/zin/wg/thinkmatrixoptions/js/v1.js index 44b381bf52..a1100e7c4f 100644 --- a/lib/zin/wg/thinkmatrixoptions/js/v1.js +++ b/lib/zin/wg/thinkmatrixoptions/js/v1.js @@ -116,6 +116,7 @@ class ThinkMatrixOptions extends zui.Component if(!dropName || dragName === dropName) return; if(this.dropSide === 'right') this.moveAfter(dragName, dropName); else this.moveBefore(dragName, dropName); + this.saveData(true); }, onDragOver: (event, dragElement, dropElement) => { @@ -165,7 +166,7 @@ class ThinkMatrixOptions extends zui.Component }); } - saveData() + saveData(isClear = false) { if(!this.options.isSaveData) return; @@ -179,6 +180,7 @@ class ThinkMatrixOptions extends zui.Component } }); $('.required-options .picker-box').zui('picker').render({items: cols}); + if(isClear) $('.required-options .picker-box').zui('picker').$.setValue(''); } getByID(id) @@ -355,8 +357,9 @@ class ThinkMatrixOptions extends zui.Component if(index > -1) siblings.splice(index, 1); } if (!this._items.length) this.update(['1'], false); + const inputValue = this.$element.find(`.think-multiple-item[data-id="${item.id}"] .think-multiple-item-text`).val(); this.render(); - this.saveData(); + this.saveData(!!inputValue); } focus(name)