unpoly-rails 3.6.0 → 3.6.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@
5
5
  /***/ (() => {
6
6
 
7
7
  window.up = {
8
- version: '3.6.0'
8
+ version: '3.6.1'
9
9
  };
10
10
 
11
11
 
@@ -2259,7 +2259,7 @@ up.Change.OpenLayer = class OpenLayer extends up.Change.Addition {
2259
2259
  }
2260
2260
  _handleHistory() {
2261
2261
  if (this.layer.history === 'auto') {
2262
- this.layer.history = up.fragment.hasAutoHistory(this._content);
2262
+ this.layer.history = up.fragment.hasAutoHistory([this._content], this.layer);
2263
2263
  }
2264
2264
  let { parent } = this.layer;
2265
2265
  this.layer.history &&= parent.history;
@@ -2445,7 +2445,7 @@ up.Change.UpdateLayer = (_a = class UpdateLayer extends up.Change.Addition {
2445
2445
  }
2446
2446
  _hasAutoHistory() {
2447
2447
  const oldFragments = u.map(this._steps, 'oldElement');
2448
- return u.some(oldFragments, up.fragment.hasAutoHistory);
2448
+ return up.fragment.hasAutoHistory(oldFragments, this.layer);
2449
2449
  }
2450
2450
  _getEffectiveRenderOptions() {
2451
2451
  return {
@@ -8533,14 +8533,15 @@ up.fragment = (function () {
8533
8533
  }
8534
8534
  return steps;
8535
8535
  }
8536
- function hasAutoHistory(fragment) {
8537
- if (contains(fragment, config.autoHistoryTargets)) {
8538
- return true;
8539
- }
8540
- else {
8541
- up.puts('up.render()', "Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets");
8542
- return false;
8536
+ function hasAutoHistory(newFragments, layer) {
8537
+ let vanillaSelector = expandTargets(config.autoHistoryTargets, { layer }).join();
8538
+ for (let newFragment of newFragments) {
8539
+ if (e.subtree(newFragment, vanillaSelector).length) {
8540
+ return true;
8541
+ }
8543
8542
  }
8543
+ up.puts('up.render()', "Will not auto-update history because fragment doesn't contain a selector from up.fragment.config.autoHistoryTargets");
8544
+ return false;
8544
8545
  }
8545
8546
  function matches(element, selector, options = {}) {
8546
8547
  element = e.get(element);