]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Undo the wrapper inner fix
authorSassNinja <kai.falkowski@gmail.com>
Tue, 13 Jun 2017 06:41:19 +0000 (08:41 +0200)
committerSassNinja <kai.falkowski@gmail.com>
Tue, 13 Jun 2017 06:41:19 +0000 (08:41 +0200)
Since wrapper inner is deprecated and erroneously implemented in the docs, I'm undoing my fix.
Once the docs got fixed, the push transition is going to work as expected.

js/foundation.offcanvas.js

index 5586436ad9db557078f6d0cb69be59137abd507d..23d6ad8de7dda0b7bc0e5f2cc3f21f6449b77c02 100644 (file)
@@ -30,7 +30,6 @@ class OffCanvas extends Plugin {
     this.$lastTrigger = $();
     this.$triggers = $();
     this.position = 'left';
-    this.$wrapperInner = $(); // prior v6.3
     this.$content = $();
     this.nested = !!(this.options.nested);
 
@@ -56,29 +55,18 @@ class OffCanvas extends Plugin {
 
     this.$element.attr('aria-hidden', 'true');
       
-    this.$wrapperInner = this.$element.parent('[data-off-canvas-wrapper]'); // prior v6.3
-
     // Find off-canvas content, either by ID (if specified), by siblings or by closest selector (fallback)
     if (this.options.contentId) {
       this.$content = $('#'+this.options.contentId);
     } else if (this.$element.siblings('[data-off-canvas-content]').length) {
       this.$content = this.$element.siblings('[data-off-canvas-content]').first();
-    } else if (this.$wrapperInner.length && this.$wrapperInner.siblings('[data-off-canvas-content]').length) {
-      this.$content = this.$wrapperInner.siblings('[data-off-canvas-content]').first();
     } else {
       this.$content = this.$element.closest('[data-off-canvas-content]').first();
     }
 
     if (!this.options.contentId) {
-
-
-      if (this.$wrapperInner.length && this.$wrapperInner.siblings('[data-off-canvas-content]').length) {
-        // If using off-canvas wrapper inner (prior v6.3), assume that the off-canvas element is not nested if the wrapper is a sibling of the content
-        this.nested = false;
-      } else {
-        // Assume that the off-canvas element is nested if it isn't a sibling of the content
-        this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;
-      }
+      // Assume that the off-canvas element is nested if it isn't a sibling of the content
+      this.nested = this.$element.siblings('[data-off-canvas-content]').length === 0;
 
     } else if (this.options.contentId && this.options.nested === null) {
       // Warning if using content ID without setting the nested option