mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-29 03:17:47 +08:00
fix(image-map): Build image map without relative path dependency
This commit is contained in:
parent
d04951dd61
commit
175db163e9
1 changed files with 7 additions and 4 deletions
|
@ -81,11 +81,14 @@ Utils =
|
|||
[name, ext] = fullname.split('.')
|
||||
|
||||
if Utils.images is undefined
|
||||
start = Date.now()
|
||||
{resourcePath} = atom.getLoadSettings()
|
||||
imagesPath = path.join(resourcePath, 'static', 'images')
|
||||
files = fs.listTreeSync(imagesPath)
|
||||
|
||||
Utils.images = {}
|
||||
files = fs.listTreeSync('./static/images')
|
||||
for file in files
|
||||
Utils.images[path.basename(file)] = file.substr(7)
|
||||
console.log('Loaded Images', Utils.images)
|
||||
Utils.images[path.basename(file)] = file for file in files
|
||||
console.log("Loaded image map in #{Date.now()-start}msec")
|
||||
|
||||
if window.devicePixelRatio > 1
|
||||
return Utils.images["#{name}@2x.#{ext}"] ? Utils.images[fullname] ? Utils.images["#{name}@1x.#{ext}"]
|
||||
|
|
Loading…
Reference in a new issue