Skip to content

Commit

Permalink
fixes for opening files on FireFix (fixed double file opening, fixed …
Browse files Browse the repository at this point in the history
…directory opening)
  • Loading branch information
viliusle committed Oct 24, 2021
1 parent aa48644 commit 076ceae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/modules/file/open.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class File_open_class {
var items = e.dataTransfer.items;
for (var i=0; i<items.length; i++) {
var item = items[i].webkitGetAsEntry();
if (item) {
if (item && item.isDirectory == true) {
this.traverseFileTree(item);
}
}
Expand All @@ -365,7 +365,9 @@ class File_open_class {
FR.file = file;

FR.onload = function (event) {
if (this.file.type.match('image.*')) {
if (this.file.type.match('image.*')
//below is fix for firefox, it has empty type
|| (this.file.type == '' && this.file.name.match(/\.(png|jpg|jpeg|webp|gif|avif)/g))) {
//image
var new_layer = {
name: this.file.name,
Expand Down

0 comments on commit 076ceae

Please sign in to comment.