navigator.share
This commit is contained in:
@@ -110,10 +110,20 @@ var Toolbar = {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var Sharebar = {
|
||||
visible: false,
|
||||
|
||||
toggle: function(){
|
||||
if (navigator.share) {
|
||||
navigator.share({
|
||||
title: Viewer.title,
|
||||
text: "Get this file from Pixeldrain!",
|
||||
url: window.location.href
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Toolbar.visible){
|
||||
Toolbar.toggle();
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
var Viewer = {
|
||||
currentFile: "",
|
||||
title: "", // Contains either the file name or list title
|
||||
listId: "",
|
||||
isList: false,
|
||||
isFile: false,
|
||||
@@ -14,18 +15,18 @@ var Viewer = {
|
||||
|
||||
// On small screens the toolbar takes too much space, so it collapses automatically
|
||||
if($("#filepreview").width() < 400 && Toolbar.visible){
|
||||
window.setTimeout(function(){
|
||||
Toolbar.toggle();
|
||||
}, 800);
|
||||
Toolbar.toggle();
|
||||
}
|
||||
|
||||
if(type === "file"){
|
||||
this.isFile = true;
|
||||
this.currentFile = data.id;
|
||||
this.title = data.name;
|
||||
this.setFile(data);
|
||||
} else if (type === "list") {
|
||||
this.isList = true;
|
||||
this.listId = data.id;
|
||||
this.title = data.title;
|
||||
ListNavigator.init(data.data);
|
||||
}
|
||||
|
||||
|
@@ -314,7 +314,7 @@ var UploadWorker = /** @class */ (function () {
|
||||
};
|
||||
UploadWorker.prototype.newFile = function () {
|
||||
var file = this.manager.grabFile();
|
||||
if (file === undefined) { // No more files in the queue. We're finished
|
||||
if (file === undefined) {
|
||||
this.uploading = false;
|
||||
console.debug("No files left in queue");
|
||||
return; // Stop the thread
|
||||
|
Reference in New Issue
Block a user