@mintjamsinc/ichigojs 0.1.84 → 0.1.85

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.
@@ -7787,13 +7787,20 @@
7787
7787
  }
7788
7788
  /**
7789
7789
  * Updates a regular attribute.
7790
+ * An attribute that already holds the value is left alone: setting `src` on
7791
+ * an <iframe>, even to the same URL, loads its page again.
7790
7792
  */
7791
7793
  #updateAttribute(element, name, value) {
7792
7794
  if (value == null || value === false) {
7793
- element.removeAttribute(name);
7795
+ if (element.hasAttribute(name)) {
7796
+ element.removeAttribute(name);
7797
+ }
7794
7798
  }
7795
7799
  else {
7796
- element.setAttribute(name, String(value));
7800
+ const text = String(value);
7801
+ if (element.getAttribute(name) !== text) {
7802
+ element.setAttribute(name, text);
7803
+ }
7797
7804
  }
7798
7805
  }
7799
7806
  }
@@ -12060,6 +12067,11 @@
12060
12067
  * The expression evaluator for this directive.
12061
12068
  */
12062
12069
  #evaluator;
12070
+ /**
12071
+ * The HTML last set on the element. The same HTML is not set again: that
12072
+ * would replace the elements inside, and load their frames and images again.
12073
+ */
12074
+ #html;
12063
12075
  /**
12064
12076
  * @param context The context for parsing the directive.
12065
12077
  */
@@ -12110,10 +12122,14 @@
12110
12122
  get dependentIdentifiers() {
12111
12123
  return identifiers;
12112
12124
  },
12113
- applyToDOM() {
12125
+ applyToDOM: () => {
12114
12126
  const element = vNode.node;
12115
- const htmlContent = evaluator.evaluate();
12116
- element.innerHTML = htmlContent ?? '';
12127
+ const htmlContent = evaluator.evaluate() ?? '';
12128
+ if (htmlContent === this.#html) {
12129
+ return;
12130
+ }
12131
+ this.#html = htmlContent;
12132
+ element.innerHTML = htmlContent;
12117
12133
  }
12118
12134
  };
12119
12135
  return updater;