middle click to open preview in new tab

This commit is contained in:
nightwing 2017-03-15 19:55:08 +00:00
parent 310eed6bf2
commit 4f4a65eba8
2 changed files with 17 additions and 12 deletions

View File

@ -99,16 +99,18 @@ define(function(require, exports, module) {
menus.addItemByPath("Tools/Preview/", submenu, 1000, handle);
liveMenuItem = new ui.item({
onclick: function() { commands.exec("preview"); }
onclick: function(e) { commands.exec("preview", { newTab: e && e.button == 1 }); }
});
menus.addItemByPath("Tools/Preview/Live Preview Files",
liveMenuItem, 100, handle);
menus.addItemByPath("Tools/Preview/Preview Running Application",
new ui.item({
onclick: function() {
commands.exec("preview", null, { server: true });
}
}), 200, handle);
menus.addItemByPath("Tools/Preview/Preview Running Application", new ui.item({
onclick: function(e) {
commands.exec("preview", null, {
server: true,
newTab: e && e.button == 1
});
}
}), 200, handle);
}
settings.on("read", function(e) {
@ -199,13 +201,15 @@ define(function(require, exports, module) {
};
function done() {
var path = (options.local ? "http" : "https")
+ "://" + hostname;
if (args.newTab)
return util.openNewWindow(path);
// Open Pane
pane = findPane();
// Open Preview
var path = (options.local ? "http" : "https")
+ "://" + hostname;
openPreview(path, pane, args && args.active);
}

View File

@ -1500,7 +1500,7 @@ apf.item = function(struct, tagName) {
};
this.$up = function() {
this.$up = function(e) {
if (this.type == "radio")
@ -1533,7 +1533,8 @@ apf.item = function(struct, tagName) {
this.dispatchEvent("click", {
xmlContext: (this.parentNode || 0).xmlReference,
opener: (this.parentNode || 0).opener
opener: (this.parentNode || 0).opener,
button: e && e.button
});