Change dom state classes to follow our classes namespaces

This commit is contained in:
Antoine Boulanger
2018-04-30 17:26:13 -04:00
parent c571aa306a
commit e2970fbeeb
2 changed files with 17 additions and 17 deletions

View File

@@ -25,8 +25,8 @@ export default class {
} }
$html $html
.removeClass('dom-is-loaded dom-is-animated ') .removeClass('has-dom-loaded has-dom-animated ')
.addClass(`dom-is-loading ${this.overrideClass}`); .addClass(`has-dom-loading ${this.overrideClass}`);
} }
@@ -54,15 +54,15 @@ export default class {
$html.attr('data-template', view.getAttribute('data-template')); $html.attr('data-template', view.getAttribute('data-template'));
setTimeout(() => { setTimeout(() => {
$html $html
.addClass('dom-is-loaded') .addClass('has-dom-loaded')
.removeClass('dom-is-loading'); .removeClass('has-dom-loading');
setTimeout(() => { setTimeout(() => {
$html $html
.removeClass(this.overrideClass) .removeClass(this.overrideClass)
.addClass('dom-is-animated'); .addClass('has-dom-animated');
}, 1000); }, 1000);
// launch it at the end (animations...) // launch it at the end (animations...)
@@ -73,7 +73,7 @@ export default class {
},1000); },1000);
} }
destroy() { destroy() {
if(isDebug) { if(isDebug) {
console.log("---- ❌ [transition]:destroy -----"); console.log("---- ❌ [transition]:destroy -----");

View File

@@ -16,13 +16,13 @@ const EVENT = {
/* /*
@todo : @todo :
- ✅ get data-transition on clicked link -> launch() and add switch(){} - ✅ get data-transition on clicked link -> launch() and add switch(){}
- ❌ add goto listener - ❌ add goto listener
- ❌ add newPageReady functon with google analytics send (maybe pjax do that?) - ❌ add newPageReady functon with google analytics send (maybe pjax do that?)
- ✅ add overrideClass system for all transitions - ✅ add overrideClass system for all transitions
- ✅ add base class manager like old DefaultTransition (dom-is-loaded, dom-is-loading etc..) - ✅ add base class manager like old DefaultTransition (has-dom-loaded, has-dom-loading etc..)
@@ -48,7 +48,7 @@ display() -> (transition) displayView() -> display animations & *readyToDestroy
export default class { export default class {
constructor() { constructor() {
// jQuery ondomready // jQuery ondomready
$window.on('load',() => { $window.on('load',() => {
@@ -131,7 +131,7 @@ export default class {
/** /**
* (PJAX) Launch when new page is loaded * (PJAX) Launch when new page is loaded
* @param {js dom element}, * @param {js dom element},
* @param {js dom element} * @param {js dom element}
* @param {options : pjax options} * @param {options : pjax options}
* @return void * @return void
@@ -140,13 +140,13 @@ export default class {
if(isDebug) { if(isDebug) {
console.log('---- Next view loaded 👌 -----'); console.log('---- Next view loaded 👌 -----');
} }
this.transition.hideView(oldView, newView); this.transition.hideView(oldView, newView);
} }
/** /**
* Launch when you trigger EVENT.READYTOREMOVE in your transition -> hideView(), at the end * Launch when you trigger EVENT.READYTOREMOVE in your transition -> hideView(), at the end
* after oldView hidden, delete modules and launch this.display() * after oldView hidden, delete modules and launch this.display()
* @param {js dom element}, * @param {js dom element},
* @param {js dom element} * @param {js dom element}
* @return void * @return void
*/ */
@@ -164,7 +164,7 @@ export default class {
/** /**
* launch after this.remove() * launch after this.remove()
* @param {js dom element}, * @param {js dom element},
* @return void * @return void
*/ */
display(view) { display(view) {
@@ -210,10 +210,10 @@ export default class {
* @return {void} * @return {void}
*/ */
load() { load() {
$html.addClass('dom-is-loaded'); $html.addClass('has-dom-loaded');
$html.removeClass('dom-is-loading'); $html.removeClass('has-dom-loading');
setTimeout(() => { setTimeout(() => {
$html.addClass('dom-is-animated'); $html.addClass('has-dom-animated');
}, 1000) }, 1000)
} }
} }