mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-07 02:04:11 +01:00
Fix :download link launching. Closes issue #558.
--HG-- extra : rebase_source : 2ca247671f5ef0373a714b8c39d1fc0c1347e00a
This commit is contained in:
@@ -32,7 +32,7 @@ var Download = Class("Download", {
|
|||||||
<tr highlight="Download" key="row" xmlns:dactyl={NS} xmlns={XHTML}>
|
<tr highlight="Download" key="row" xmlns:dactyl={NS} xmlns={XHTML}>
|
||||||
<td highlight="DownloadTitle">
|
<td highlight="DownloadTitle">
|
||||||
<span highlight="Link">
|
<span highlight="Link">
|
||||||
<a key="launch" dactyl:command="download.command"
|
<a key="launch"
|
||||||
href={self.target.spec} path={self.targetFile.path}>{self.displayName}</a>
|
href={self.target.spec} path={self.targetFile.path}>{self.displayName}</a>
|
||||||
<span highlight="LinkInfo">{self.targetFile.path}</span>
|
<span highlight="LinkInfo">{self.targetFile.path}</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -57,6 +57,13 @@ var Download = Class("Download", {
|
|||||||
</tr>,
|
</tr>,
|
||||||
this.list.document, this.nodes);
|
this.list.document, this.nodes);
|
||||||
|
|
||||||
|
this.nodes.launch.addEventListener("click", function (event) {
|
||||||
|
if (event.button == 0) {
|
||||||
|
event.preventDefault();
|
||||||
|
self.command("launch");
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
self.updateStatus();
|
self.updateStatus();
|
||||||
return self;
|
return self;
|
||||||
},
|
},
|
||||||
@@ -82,7 +89,10 @@ var Download = Class("Download", {
|
|||||||
util.assert(set.has(this.allowedCommands, name), _("download.unknownCommand"));
|
util.assert(set.has(this.allowedCommands, name), _("download.unknownCommand"));
|
||||||
util.assert(this.allowedCommands[name], _("download.commandNotAllowed"));
|
util.assert(this.allowedCommands[name], _("download.commandNotAllowed"));
|
||||||
|
|
||||||
services.downloadManager[name + "Download"](this.id);
|
if (set.has(this.commands, name))
|
||||||
|
this.commands[name].call(this);
|
||||||
|
else
|
||||||
|
services.downloadManager[name + "Download"](this.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
commands: {
|
commands: {
|
||||||
|
|||||||
Reference in New Issue
Block a user