mirror of https://github.com/Lissy93/dashy.git
🐛 Re: #199 - Fixes loading of local SVG icons
This commit is contained in:
parent
b756e65d2e
commit
412c179d5a
|
@ -62,7 +62,7 @@ export default {
|
||||||
/* Returns true if the input is a path to an image file */
|
/* Returns true if the input is a path to an image file */
|
||||||
isImage(img) {
|
isImage(img) {
|
||||||
const fileExtRegex = /(?:\.([^.]+))?$/;
|
const fileExtRegex = /(?:\.([^.]+))?$/;
|
||||||
const validImgExtensions = ['png', 'jpg'];
|
const validImgExtensions = ['svg', 'png', 'jpg'];
|
||||||
const splitPath = fileExtRegex.exec(img);
|
const splitPath = fileExtRegex.exec(img);
|
||||||
if (splitPath.length >= 1) return validImgExtensions.includes(splitPath[1]);
|
if (splitPath.length >= 1) return validImgExtensions.includes(splitPath[1]);
|
||||||
return false;
|
return false;
|
||||||
|
@ -154,7 +154,6 @@ export default {
|
||||||
determineImageType(img) {
|
determineImageType(img) {
|
||||||
let imgType = '';
|
let imgType = '';
|
||||||
if (!img) imgType = 'none';
|
if (!img) imgType = 'none';
|
||||||
else if (img.endsWith('.svg')) imgType = 'svg';
|
|
||||||
else if (this.isUrl(img)) imgType = 'url';
|
else if (this.isUrl(img)) imgType = 'url';
|
||||||
else if (this.isImage(img)) imgType = 'img';
|
else if (this.isImage(img)) imgType = 'img';
|
||||||
else if (img.includes('fa-')) imgType = 'font-awesome';
|
else if (img.includes('fa-')) imgType = 'font-awesome';
|
||||||
|
|
Loading…
Reference in New Issue