@yuneta/gobj-ui 7.14.0 → 7.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23752,7 +23752,6 @@ function remote_command(gobj, command, kw) {
23752
23752
  function build_model(gobj) {
23753
23753
  let priv = gobj.priv;
23754
23754
  priv.model = build_schema_model(priv.records);
23755
- priv.order_undo = {};
23756
23755
  priv.baseline = {};
23757
23756
  for (let treedb of priv.model.treedbs) for (let topic of treedb.topics) priv.baseline[topic.id] = topic.topic_version;
23758
23757
  }
@@ -25837,7 +25836,8 @@ function version_writes(gobj, topic) {
25837
25836
  ***************************************************************/
25838
25837
  function remember_order(gobj, topic) {
25839
25838
  let priv = gobj.priv;
25840
- if (!topic || !priv.order_undo || priv.order_undo[topic.id]) return;
25839
+ if (!priv.order_undo) priv.order_undo = {};
25840
+ if (!topic || priv.order_undo[topic.id]) return;
25841
25841
  priv.order_undo[topic.id] = topic.cols.map((col) => {
25842
25842
  return {
25843
25843
  id: col.id,
@@ -26069,6 +26069,7 @@ function ac_mt_command_answer(gobj, event, kw, src) {
26069
26069
  render(gobj);
26070
26070
  return 0;
26071
26071
  }
26072
+ priv.order_undo = {};
26072
26073
  build_model(gobj);
26073
26074
  return go(gobj, priv.treedb_id, priv.topic_name, priv.diagram, false);
26074
26075
  }
@@ -23739,7 +23739,6 @@ function remote_command(gobj, command, kw) {
23739
23739
  function build_model(gobj) {
23740
23740
  let priv = gobj.priv;
23741
23741
  priv.model = build_schema_model(priv.records);
23742
- priv.order_undo = {};
23743
23742
  priv.baseline = {};
23744
23743
  for (let treedb of priv.model.treedbs) for (let topic of treedb.topics) priv.baseline[topic.id] = topic.topic_version;
23745
23744
  }
@@ -25824,7 +25823,8 @@ function version_writes(gobj, topic) {
25824
25823
  ***************************************************************/
25825
25824
  function remember_order(gobj, topic) {
25826
25825
  let priv = gobj.priv;
25827
- if (!topic || !priv.order_undo || priv.order_undo[topic.id]) return;
25826
+ if (!priv.order_undo) priv.order_undo = {};
25827
+ if (!topic || priv.order_undo[topic.id]) return;
25828
25828
  priv.order_undo[topic.id] = topic.cols.map((col) => {
25829
25829
  return {
25830
25830
  id: col.id,
@@ -26056,6 +26056,7 @@ function ac_mt_command_answer(gobj, event, kw, src) {
26056
26056
  render(gobj);
26057
26057
  return 0;
26058
26058
  }
26059
+ priv.order_undo = {};
26059
26060
  build_model(gobj);
26060
26061
  return go(gobj, priv.treedb_id, priv.topic_name, priv.diagram, false);
26061
26062
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.14.0",
3
+ "version": "7.14.1",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -528,9 +528,6 @@ function build_model(gobj)
528
528
  let priv = gobj.priv;
529
529
 
530
530
  priv.model = build_schema_model(priv.records);
531
- /* The order to go back to is the one that was on screen; a reload
532
- * brings the stored one, so what was on screen is gone. */
533
- priv.order_undo = {};
534
531
  priv.baseline = {};
535
532
  for(let treedb of priv.model.treedbs) {
536
533
  for(let topic of treedb.topics) {
@@ -2166,7 +2163,10 @@ function remember_order(gobj, topic)
2166
2163
  {
2167
2164
  let priv = gobj.priv;
2168
2165
 
2169
- if(!topic || !priv.order_undo || priv.order_undo[topic.id]) {
2166
+ if(!priv.order_undo) {
2167
+ priv.order_undo = {};
2168
+ }
2169
+ if(!topic || priv.order_undo[topic.id]) {
2170
2170
  return; /* the first drag already said where we started */
2171
2171
  }
2172
2172
  priv.order_undo[topic.id] = topic.cols.map((col) => {
@@ -2528,6 +2528,11 @@ function ac_mt_command_answer(gobj, event, kw, src)
2528
2528
  render(gobj);
2529
2529
  return 0;
2530
2530
  }
2531
+ /* Records straight from the store: what an undo would name is the
2532
+ * order that was ON SCREEN, and this is the stored one arriving.
2533
+ * (NOT in build_model(): that also runs on the patch after every
2534
+ * write, which is exactly when the undo has to survive.) */
2535
+ priv.order_undo = {};
2531
2536
  build_model(gobj);
2532
2537
  /* Back to where the operator was: the load may be a refresh, or
2533
2538
  * the answer to a deep link that arrived before the model. */