mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
middle click to open preview in new tab
This commit is contained in:
parent
310eed6bf2
commit
4f4a65eba8
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
});
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user