modularload
Advanced tools
Comparing version 1.1.7 to 1.1.8
{ | ||
"name": "modularload", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Dead simple page transitions and lazy loading.", | ||
@@ -5,0 +5,0 @@ "repository": "modularorg/modularload", |
@@ -126,9 +126,10 @@ <p align="center"> | ||
| `name` | `string` | `'load'` | Data attributes name | | ||
| `loadingClass` | `string` | `'is-loading'` | Class when a link is clicked | | ||
| `loadedClass` | `string` | `'is-loaded'` | Class when the new container enters | | ||
| `readyClass` | `string` | `'is-ready'` | Class when the old container exits | | ||
| `transitionsPrefix` | `string` | `'is-'` | Custom transitions class prefix | | ||
| `enterDelay` | `number` | `0` | Minimum delay before the new container enters | | ||
| `exitDelay` | `number` | `0` | Delay before the old container exists after the new enters | | ||
| `transitions` | `object` | `{}` | Custom transitions options | | ||
| `loadingClass` | `string` | `'is-loading'` | Class when a link is clicked. | | ||
| `loadedClass` | `string` | `'is-loaded'` | Class when the new container enters. | | ||
| `readyClass` | `string` | `'is-ready'` | Class when the old container exits. | | ||
| `transitionsPrefix` | `string` | `'is-'` | Custom transitions class prefix. | | ||
| `enterDelay` | `number` | `0` | Minimum delay before the new container enters. | | ||
| `exitDelay` | `number` | `0` | Delay before the old container exists after the new enters. | | ||
| `loadedDelay` | `number` | `0` | Delay before adding the loaded class. For example, to wait for your JS DOM updates. | | ||
| `transitions` | `object` | `{}` | Custom transitions options. | | ||
@@ -138,9 +139,9 @@ ## Attributes | ||
| --------- | ------ | ----------- | | ||
| `data-load-container` | ` `, `string` | Container you want to load with optional string | | ||
| `data-load` | `string`, `false` | Transition name or disable transition | | ||
| `data-load-url` | `boolean` | Update url without loading container | | ||
| `data-load-src` | `string` | Lazy load src attribute | | ||
| `data-load-srcset` | `string` | Lazy load srcset attribute | | ||
| `data-load-style` | `string` | Lazy load style attribute | | ||
| `data-load-href` | `string` | Lazy load href attribute | | ||
| `data-load-container` | ` `, `string` | Container you want to load with optional string. | | ||
| `data-load` | `string`, `false` | Transition name or disable transition. | | ||
| `data-load-url` | `boolean` | Update url without loading container. | | ||
| `data-load-src` | `string` | Lazy load src attribute. | | ||
| `data-load-srcset` | `string` | Lazy load srcset attribute. | | ||
| `data-load-style` | `string` | Lazy load style attribute. | | ||
| `data-load-href` | `string` | Lazy load href attribute. | | ||
@@ -150,5 +151,5 @@ ## Events | ||
| ----- | --------- | ----------- | | ||
| `loading` | `transition`, `oldContainer` | On link click | | ||
| `loaded` | `transition`, `oldContainer`, `newContainer` | On new container enter | | ||
| `ready` | `transition`, `newContainer` | On old container exit | | ||
| `images` | | On all images load | | ||
| `loading` | `transition`, `oldContainer` | On link click. | | ||
| `loaded` | `transition`, `oldContainer`, `newContainer` | On new container enter. | | ||
| `ready` | `transition`, `newContainer` | On old container exit. | | ||
| `images` | | On all images load. | |
@@ -11,2 +11,3 @@ export default class { | ||
exitDelay: 0, | ||
loadedDelay: 0, | ||
isLoaded: false, | ||
@@ -129,2 +130,3 @@ isEntered: false, | ||
this.exitDelay = this.transitions[this.transition].exitDelay || this.exitDelay; | ||
this.loadedDelay = this.transitions[this.transition].loadedDelay || this.loadedDelay; | ||
@@ -226,3 +228,3 @@ oldContainer = document.querySelector(this.transitionContainer); | ||
.catch(err => { | ||
console.log(err); | ||
}) | ||
@@ -335,4 +337,7 @@ | ||
this.classContainer.classList.remove(this.loadingClass); | ||
this.classContainer.classList.add(this.loadedClass); | ||
setTimeout(() => { | ||
this.classContainer.classList.add(this.loadedClass); | ||
}, this.loadedDelay); | ||
const loadedEvent = new Event(this.namespace + 'loaded'); | ||
@@ -339,0 +344,0 @@ window.dispatchEvent(loadedEvent); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45255
1131
153