Skip to content

Commit

Permalink
A slightly different check for Galaxy object definition that doesn't …
Browse files Browse the repository at this point in the history
…assume a window-attached Galaxy context, only a parent. Minor cleanup.
  • Loading branch information
dannon committed Feb 4, 2016
1 parent d93f095 commit 61f168d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
12 changes: 5 additions & 7 deletions client/galaxy/scripts/mvc/tours.js
Expand Up @@ -10,7 +10,7 @@

define(['libs/bootstrap-tour'],function(BootstrapTour) {

var gxy_root = Galaxy === undefined ? '/' : Galaxy.root;
var gxy_root = typeof Galaxy === "undefined" ? '/' : Galaxy.root;

var tour_opts = { storage: window.sessionStorage,
onEnd: function(){
Expand Down Expand Up @@ -76,26 +76,24 @@ define(['libs/bootstrap-tour'],function(BootstrapTour) {
tour.restart();
});
};

var ToursView = Backbone.View.extend({
// initialize
initialize: function(options) {
initialize: function() {
var self = this;
this.setElement('<div/>');
this.model = new Tours();
this.model.fetch({
success: function( model ){
success: function(){
self.render();
},
error: function( model, response ){
error: function(){
// Do something.
console.error("Failed to fetch tours.");
}
});
},

render: function(){
var self = this;
var tpl = _.template([
"<h2>Galaxy Tours</h2>",
"<p>This page presents a list of interactive tours available on this Galaxy server. ",
Expand All @@ -110,7 +108,7 @@ define(['libs/bootstrap-tour'],function(BootstrapTour) {
'</li>',
'<% }); %>',
"</ul>"].join(''));
this.$el.html(tpl({tours: this.model.models})).on("click", ".tourItem", function(e){
this.$el.html(tpl({tours: this.model.models})).on("click", ".tourItem", function(){
giveTour($(this).data("tour.id"));
});
}
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/tours.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 61f168d

Please sign in to comment.