Skip to content

Commit

Permalink
Parse panel hiding options for scratchbook embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Feb 11, 2018
1 parent a109ca9 commit 50c8cb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/galaxy/scripts/layout/scratchbook.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export default Backbone.View.extend({

/** Add and display a new frame/window based on options. */
add: function(options) {
options.url += (options.url.indexOf("?") == -1 ? "?" : "&");
if (options.target == "_blank") {
window.open(options.url);
} else if (options.target == "_top" || options.target == "_parent" || options.target == "_self") {
Expand All @@ -218,12 +219,13 @@ export default Backbone.View.extend({
var $galaxy_main = $(window.parent.document).find("#galaxy_main");
if (options.target == "galaxy_main" || options.target == "center") {
if ($galaxy_main.length === 0) {
window.location = `${options.url + (options.url.indexOf("?") == -1 ? "?" : "&")}use_panels=True`;
window.location = `${options.url}use_panels=True`;
} else {
$galaxy_main.attr("src", options.url);
}
} else window.location = options.url;
} else {
options.url = `${options.url}hide_panels=true&hide_masthead=true`;
this.frames.add(options);
}
}
Expand Down

0 comments on commit 50c8cb3

Please sign in to comment.