Skip to content

Commit 5f71a8b

Browse files
author
Colt Pini
committed
Removed the lazyload prop in favor of the data-src to src pattern.
1 parent 4aa99be commit 5f71a8b

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

include-fragment-element.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,6 @@ export class IncludeFragmentElement extends HTMLElement {
6969
}
7070
}
7171

72-
get lazyload() {
73-
return this.hasAttribute('lazyload')
74-
}
75-
set lazyload(val) {
76-
if (val) {
77-
this.setAttribute('lazyload', '')
78-
} else {
79-
this.removeAttribute('lazyload')
80-
}
81-
}
82-
8372
get data() {
8473
return getData(this)
8574
}
@@ -150,10 +139,6 @@ export class IncludeFragmentElement extends HTMLElement {
150139
)
151140
}
152141

153-
get() {
154-
handleData(this)
155-
}
156-
157142
fetch(request) {
158143
return fetch(request)
159144
}

test/test.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -312,28 +312,4 @@ suite('include-fragment-element', function() {
312312
elem.src = '/hello'
313313
}, 10)
314314
})
315-
316-
test('only loads when called if the lazyload property is set.', done => {
317-
let hasRun = false
318-
const elem = document.createElement('include-fragment')
319-
elem.src = '/hello'
320-
elem.lazyload = true
321-
322-
elem.addEventListener('loadstart', () => {
323-
hasRun = true
324-
})
325-
326-
elem.addEventListener('loadend', () => {
327-
checkAsync(done, () => {
328-
assert.ok(document.querySelector('#replaced'))
329-
})
330-
})
331-
332-
document.body.appendChild(elem)
333-
334-
setTimeout(function() {
335-
assert.ok(!hasRun)
336-
elem.get()
337-
}, 10)
338-
})
339315
})

0 commit comments

Comments
 (0)