mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 07:16:18 -04:00
file preview feature added
This commit is contained in:
parent
5c4aeb0108
commit
a593ef1a6e
3 changed files with 19 additions and 1 deletions
|
@ -266,6 +266,11 @@ class ReceiveDialog extends Dialog {
|
|||
$a.click()
|
||||
return
|
||||
}
|
||||
if(file.mime.split('/')[0] === 'image'){
|
||||
console.log('the file is image');
|
||||
this.$el.querySelector('.preview').style.visibility = 'inherit';
|
||||
this.$el.querySelector("#img-preview").src = url;
|
||||
}
|
||||
|
||||
this.$el.querySelector('#fileName').textContent = file.name;
|
||||
this.$el.querySelector('#fileSize').textContent = this._formatFileSize(file.size);
|
||||
|
@ -292,6 +297,8 @@ class ReceiveDialog extends Dialog {
|
|||
}
|
||||
|
||||
hide() {
|
||||
this.$el.querySelector('.preview').style.visibility = 'hidden';
|
||||
this.$el.querySelector("#img-preview").src = "";
|
||||
super.hide();
|
||||
this._dequeueFile();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue