Commit a7d5e8b5 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Redirection to rendered data is done in new tab

parent 55b64dfe
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
domsugar("div", {class: "caption"}, [ domsugar("div", {class: "caption"}, [
domsugar("h3", {text: app_list[i].application_title}), domsugar("h3", {text: app_list[i].application_title}),
domsugar("a", {href: url_list[i], class:"btn btn-default", role:"button", text:"Edit"}), domsugar("a", {href: url_list[i], class:"btn btn-default", role:"button", text:"Edit"}),
domsugar("a", {href: base_url + tmp_url , class:"btn btn-primary", role:"button", text:"GO"}) domsugar("a", {href: base_url + tmp_url , class:"btn btn-primary", role:"button", text:"GO", target: "_blank"})
]) ])
]) ])
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
if (event.submitter.name === "go") { if (event.submitter.name === "go") {
return gadget.redirect({ return gadget.redirect({
url: window.location.origin + window.location.pathname + url, url: window.location.origin + window.location.pathname + url,
toExternal: true newTab: true
}); });
} }
return gadget.redirect({page: "editor", url: url}); return gadget.redirect({page: "editor", url: url});
......
...@@ -70,9 +70,15 @@ ...@@ -70,9 +70,15 @@
}) })
.declareMethod('redirect', function (options) { .declareMethod('redirect', function (options) {
if (options !== undefined && options.toExternal) { if (options !== undefined) {
window.location.replace(options.url); if (options.toExternal) {
return RSVP.timeout(REDIRECT_TIMEOUT); // timeout if not redirected window.location.replace(options.url);
return RSVP.timeout(REDIRECT_TIMEOUT); // timeout if not redirected
}
if (options.newTab) {
window.open(options.url, '_blank');
return;
}
} }
else { else {
return this.getCommandUrlFor(options) return this.getCommandUrlFor(options)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment