naver / egjs

Javascript components group that brings easiest and fastest way to build a web application in your way.
https://naver.github.io/egjs
Other
935 stars 80 forks source link

InfinteGrid show x-boxs when Image is failed #483

Closed sculove closed 7 years ago

sculove commented 7 years ago

Description

sculove commented 7 years ago

proposal

usage
new eg.InfiniteGrid("#grid", {
    itemSelector: ".item"
}).on({
    "beforeImageError": function(e) {
        // e.src : image url
        // e.stop() // The item isn't removed then, `imageError` event is stopped.
    },
    "imageError": function(e) {
        // e.src : image url
    },
});
sculove commented 7 years ago

proposal

usage
new eg.InfiniteGrid("#grid", {
    itemSelector: ".item"
}).on({
    "imageError": function(e) {
        // e.target: image element. - replace image element or src
        // e.item: item element. - If the item was previously deleted, this value is null.
    },
});
sculove commented 7 years ago

imageError => exception and use e.type === "image"

we decide error

sculove commented 7 years ago

this issue is closed. I f/w https://github.com/naver/egjs-infinitegrid/issues/1