diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js index acede2b..01db501 100644 --- a/core/modules/tour/js/tour.js +++ b/core/modules/tour/js/tour.js @@ -76,6 +76,7 @@ initialize: function () { this.listenTo(this.model, 'change:tour change:isActive', this.render); this.listenTo(this.model, 'change:isActive', this.toggleTour); + $(document).on('drupalViewportOffsetChange', _.bind(this.refreshPosition, this)); }, /** @@ -118,6 +119,19 @@ }, /** + * Refresh the position of the tour. + */ + refreshPosition : function() { + var $tour = this._getTour(); + if ($tour.joyride('is_phone')) { + $tour.joyride('pos_phone'); + } + else{ + $tour.joyride('pos_default'); + } + }, + + /** * Toolbar tab click event handler; toggles isActive. */ onClick: function (event) {