From cb6d8c7394e8ca4bf64b48a3ae179eb569a511e6 Mon Sep 17 00:00:00 2001 From: ferferga Date: Sat, 16 May 2020 15:12:44 +0200 Subject: [PATCH] Remove imageFetcher --- src/components/images/imageFetcher.js | 38 --------------------------- 1 file changed, 38 deletions(-) delete mode 100644 src/components/images/imageFetcher.js diff --git a/src/components/images/imageFetcher.js b/src/components/images/imageFetcher.js deleted file mode 100644 index c6882ddb7c..0000000000 --- a/src/components/images/imageFetcher.js +++ /dev/null @@ -1,38 +0,0 @@ -define(['dom'], function (dom) { - 'use strict'; - - function loadImage(elem, url) { - - if (!elem) { - return Promise.reject('elem cannot be null'); - } - - if (elem.tagName !== 'IMG') { - - elem.style.backgroundImage = "url('" + url + "')"; - return Promise.resolve(); - - //return loadImageIntoImg(document.createElement('img'), url).then(function () { - // elem.style.backgroundImage = "url('" + url + "')"; - // return Promise.resolve(); - //}); - - } - return loadImageIntoImg(elem, url); - } - - function loadImageIntoImg(elem, url) { - return new Promise(function (resolve, reject) { - - dom.addEventListener(elem, 'load', resolve, { - once: true - }); - elem.setAttribute('src', url); - }); - } - - return { - loadImage: loadImage - }; - -});