diff --git a/client/galaxy/scripts/mvc/tours.js b/client/galaxy/scripts/mvc/tours.js index 6439971d2a7..8be51232877 100644 --- a/client/galaxy/scripts/mvc/tours.js +++ b/client/galaxy/scripts/mvc/tours.js @@ -96,28 +96,8 @@ var Tours = Backbone.Collection.extend({ model: TourItem }); -let giveTourWithData = data => { - let hookedTourData = hooked_tour_from_data(data); - sessionStorage.setItem("activeGalaxyTour", JSON.stringify(data)); - // Store tour steps in sessionStorage to easily persist w/o hackery. - let tour = new Tour(_.extend({ steps: hookedTourData.steps }, tour_opts)); - // Always clean restart, since this is a new, explicit execution. - tour.init(); - tour.goTo(0); - tour.restart(); - return tour; -}; - -var giveTourById = tour_id => { - var url = `${gxy_root}api/tours/${tour_id}`; - $.getJSON(url, data => { - giveTourWithData(data); - }); -}; - -var ToursView = Backbone.View.extend({ +export var ToursView = Backbone.View.extend({ title: _l("Tours"), - // initialize initialize: function() { var self = this; this.setElement("
"); @@ -183,6 +163,25 @@ var ToursView = Backbone.View.extend({ } }); +export function giveTourWithData(data) { + let hookedTourData = hooked_tour_from_data(data); + sessionStorage.setItem("activeGalaxyTour", JSON.stringify(data)); + // Store tour steps in sessionStorage to easily persist w/o hackery. + let tour = new Tour(_.extend({ steps: hookedTourData.steps }, tour_opts)); + // Always clean restart, since this is a new, explicit execution. + tour.init(); + tour.goTo(0); + tour.restart(); + return tour; +} + +export function giveTourById(tour_id) { + var url = `${gxy_root}api/tours/${tour_id}`; + $.getJSON(url, data => { + giveTourWithData(data); + }); +} + export function activeGalaxyTourRunner() { var et = JSON.parse(sessionStorage.getItem("activeGalaxyTour")); if (et) {