Skip to content

Commit

Permalink
Added open link in new tab. Suggested in issue [273](JonyEpsilon/gori…
Browse files Browse the repository at this point in the history
…lla-repl#273) from the original repo.

Not sure if the keyboard bindings is the best, (Alt+t)+(Alt+n), other suggestions are welcome.

Signed-off-by: MawiraIke <mawiraike@gmail.com>
  • Loading branch information
MawiraIke committed Dec 31, 2019
1 parent 41d64ea commit 99ca5f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/gorilla-repl-client/js/commandProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,14 @@ commandList = [
action: function () {
eventBus.trigger("worksheet:reindent");
}
},
{
name: "command:app:open-new-tab",
desc: "Open current link in new tab.",
showInMenu: true,
kb: combo('t', 'n'),
action: function () {
eventBus.trigger("app:open-new-tab");
}
}
];
4 changes: 4 additions & 0 deletions resources/gorilla-repl-client/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ var app = function () {
self.docViewer.hide();
});

eventBus.on("app:open-new-tab", function (e, d) {
window.open(window.location.href);
});

return self;
};

Expand Down

0 comments on commit 99ca5f2

Please sign in to comment.