delete modules before removing the old container
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* jshint esnext: true */
|
||||
import { APP_NAME, $document } from './utils/environment';
|
||||
import { APP_NAME, $document, $barba } from './utils/environment';
|
||||
|
||||
import globals from './globals';
|
||||
|
||||
@@ -107,7 +107,7 @@ class App {
|
||||
} else if (event.$scope instanceof jQuery && event.$scope.length > 0) {
|
||||
$moduleEls = event.$scope.find('[data-module]');
|
||||
} else if (event.isBarba) {
|
||||
$moduleEls = $('#js-barba-wrapper').find('[data-module]');
|
||||
$moduleEls = $barba.find('[data-module]');
|
||||
}
|
||||
|
||||
// Loop through elements
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* jshint esnext: true */
|
||||
import { APP_NAME, $document, $html } from '../utils/environment';
|
||||
import { APP_NAME, $document, $html, $barba } from '../utils/environment';
|
||||
import { EVENT as APP_EVENT } from '../App';
|
||||
|
||||
function DefaultTransition(options) {
|
||||
@@ -24,6 +24,11 @@ function DefaultTransition(options) {
|
||||
}, 1000);
|
||||
},
|
||||
finish: function() {
|
||||
$document.triggerHandler({
|
||||
type: APP_EVENT.DELETE_SCOPED_MODULES,
|
||||
$scope: $barba
|
||||
});
|
||||
|
||||
this.done();
|
||||
|
||||
const $el = $(this.newContainer);
|
||||
|
||||
@@ -5,6 +5,7 @@ const $document = $(document);
|
||||
const $window = $(window);
|
||||
const $html = $(document.documentElement).removeClass('has-no-js').addClass('has-js');
|
||||
const $body = $(document.body);
|
||||
const $barba = $('#js-barba-wrapper');
|
||||
|
||||
const isDebug = !!$html.data('debug');
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user