Fixes lint issues in /home/yash/GitHub/dev.to/app/assets/javascripts/utilities/ - browserStoreCache.js - checkUserLoggedIn.js - createAjaxReq.js - getCurrentPage.js - getImageForLink.js - insertAfter.js - localDateTime.js - localStorageTest.js - preventDefaultAction.js Signed-off-by: Amorpheuz <mail2ypd@gmail.com>
11 lines
293 B
JavaScript
11 lines
293 B
JavaScript
'use strict';
|
|
|
|
var $fetchedImageUrls = [];
|
|
function getImageForLink(elem) {
|
|
var imageUrl = elem.getAttribute('data-preload-image');
|
|
if (imageUrl && $fetchedImageUrls.indexOf(imageUrl) === -1) {
|
|
var img = new Image();
|
|
img.src = imageUrl;
|
|
$fetchedImageUrls.push(imageUrl);
|
|
}
|
|
}
|