mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Attach toplevel or global viz stuff to window (force_left_panel, force_right_panel, galaxy_config).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import _l from "utils/localization";
|
||||
import * as _ from "libs/underscore";
|
||||
import * as d3 from "d3";
|
||||
import {event as currentEvent} from "d3";
|
||||
import { event as currentEvent } from "d3";
|
||||
import visualization from "viz/visualization";
|
||||
import mod_utils from "utils/utils";
|
||||
import config from "utils/config";
|
||||
@@ -1099,9 +1099,9 @@ var Circster = Backbone.View.extend({
|
||||
// load css
|
||||
mod_utils.cssLoadFile("static/style/circster.css");
|
||||
// -- Configure visualization --
|
||||
var genome = new visualization.Genome(galaxy_config.app.genome);
|
||||
var genome = new visualization.Genome(window.galaxy_config.app.genome);
|
||||
|
||||
var vis = new visualization.GenomeVisualization(galaxy_config.app.viz_config);
|
||||
var vis = new visualization.GenomeVisualization(window.galaxy_config.app.viz_config);
|
||||
|
||||
// Add Circster-specific config options.
|
||||
vis.get("config").add([
|
||||
@@ -1141,7 +1141,7 @@ var Circster = Backbone.View.extend({
|
||||
|
||||
// setup title
|
||||
$("#center .unified-panel-header-inner").append(
|
||||
`${galaxy_config.app.viz_config.title} ${galaxy_config.app.viz_config.dbkey}`
|
||||
`${window.galaxy_config.app.viz_config.title} ${window.galaxy_config.app.viz_config.dbkey}`
|
||||
);
|
||||
|
||||
// setup menu
|
||||
|
||||
@@ -152,7 +152,7 @@ var TracksterUI = Base.extend({
|
||||
title: _l("Bookmarks"),
|
||||
on_click: function() {
|
||||
// HACK -- use style to determine if panel is hidden and hide/show accordingly.
|
||||
force_right_panel($("div#right").css("right") == "0px" ? "hide" : "show");
|
||||
window.force_right_panel($("div#right").css("right") == "0px" ? "hide" : "show");
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -408,10 +408,10 @@ var TracksterView = Backbone.View.extend({
|
||||
});
|
||||
|
||||
// hide right panel
|
||||
force_right_panel("hide");
|
||||
window.force_right_panel("hide");
|
||||
|
||||
// check if id is available
|
||||
if (galaxy_config.app.id) {
|
||||
if (window.galaxy_config.app.id) {
|
||||
this.view_existing();
|
||||
} else if (query_string.get("dataset_id")) {
|
||||
this.choose_existing_or_new();
|
||||
@@ -484,7 +484,7 @@ var TracksterView = Backbone.View.extend({
|
||||
// view
|
||||
view_existing: function() {
|
||||
// get config
|
||||
var viz_config = galaxy_config.app.viz_config;
|
||||
var viz_config = window.galaxy_config.app.viz_config;
|
||||
|
||||
// view
|
||||
view = ui.create_visualization(
|
||||
@@ -534,8 +534,8 @@ var TracksterView = Backbone.View.extend({
|
||||
|
||||
// select default
|
||||
var dbkeys_in_genomes = response.map(r => r[1]);
|
||||
if (galaxy_config.app.default_dbkey && _.contains(dbkeys_in_genomes, galaxy_config.app.default_dbkey)) {
|
||||
$("#new-dbkey").val(galaxy_config.app.default_dbkey);
|
||||
if (window.galaxy_config.app.default_dbkey && _.contains(dbkeys_in_genomes, window.galaxy_config.app.default_dbkey)) {
|
||||
$("#new-dbkey").val(window.galaxy_config.app.default_dbkey);
|
||||
}
|
||||
|
||||
// change focus
|
||||
@@ -589,7 +589,7 @@ var TracksterView = Backbone.View.extend({
|
||||
name: name,
|
||||
dbkey: dbkey
|
||||
},
|
||||
galaxy_config.app.gene_region
|
||||
window.galaxy_config.app.gene_region
|
||||
);
|
||||
|
||||
// initialize editor
|
||||
@@ -605,9 +605,9 @@ var TracksterView = Backbone.View.extend({
|
||||
$("#center .unified-panel-title").text(`${view.config.get_value("name")} (${view.dbkey})`);
|
||||
|
||||
// add dataset
|
||||
if (galaxy_config.app.add_dataset)
|
||||
if (window.galaxy_config.app.add_dataset)
|
||||
$.ajax({
|
||||
url: `${Galaxy.root}api/datasets/${galaxy_config.app.add_dataset}`,
|
||||
url: `${Galaxy.root}api/datasets/${window.galaxy_config.app.add_dataset}`,
|
||||
data: { hda_ldda: "hda", data_type: "track_config" },
|
||||
dataType: "json",
|
||||
success: function(track_data) {
|
||||
|
||||
@@ -98,13 +98,13 @@
|
||||
|
||||
%if self.has_left_panel:
|
||||
var lp = new panels.LeftPanel({ el: '#left' });
|
||||
force_left_panel = function( x ) { lp.force_panel( x ) };
|
||||
window.force_left_panel = function( x ) { lp.force_panel( x ) };
|
||||
%endif
|
||||
|
||||
%if self.has_right_panel:
|
||||
var rp = new panels.RightPanel({ el: '#right' });
|
||||
window.handle_minwidth_hint = function( x ) { rp.handle_minwidth_hint( x ) };
|
||||
force_right_panel = function( x ) { rp.force_panel( x ) };
|
||||
window.force_right_panel = function( x ) { rp.force_panel( x ) };
|
||||
%endif
|
||||
|
||||
%if t.webapp.name == 'galaxy' and app.config.ga_code:
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
|
||||
// extra configuration global
|
||||
var galaxy_config = ${ h.dumps( self.galaxy_config ) };
|
||||
window.galaxy_config = galaxy_config;
|
||||
</script>
|
||||
|
||||
${h.js(
|
||||
@@ -146,14 +147,14 @@
|
||||
## configure left panel
|
||||
%if self.galaxy_config['left_panel']:
|
||||
var lp = new panels.LeftPanel({ el: '#left' });
|
||||
force_left_panel = function( x ) { lp.force_panel( x ) };
|
||||
window.force_left_panel = function( x ) { lp.force_panel( x ) };
|
||||
%endif
|
||||
|
||||
## configure right panel
|
||||
%if self.galaxy_config['right_panel']:
|
||||
var rp = new panels.RightPanel({ el: '#right' });
|
||||
window.handle_minwidth_hint = function( x ) { rp.handle_minwidth_hint( x ) };
|
||||
force_right_panel = function( x ) { rp.force_panel( x ) };
|
||||
window.force_right_panel = function( x ) { rp.force_panel( x ) };
|
||||
%endif
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
Reference in New Issue
Block a user