Skip to content

Commit

Permalink
back and forward navigation fixed for charts page
Browse files Browse the repository at this point in the history
  • Loading branch information
buck54321 authored and chappjc committed Dec 7, 2018
1 parent af8bfca commit ce5e93c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/js/controllers/charts_controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global Dygraph */
/* global Turbolinks */
/* global $ */

import { Controller } from 'stimulus'
Expand Down Expand Up @@ -181,6 +182,7 @@ export default class extends Controller {
if (this.chartsView !== undefined) {
this.chartsView.destroy()
}
selectedChart = null
}

drawInitialGraph () {
Expand Down Expand Up @@ -214,7 +216,7 @@ export default class extends Controller {

plotGraph (chartName, data) {
var d = []
window.history.pushState({}, chartName, `#${chartName}`)
Turbolinks.controller.replaceHistoryWithLocationAndRestorationIdentifier(Turbolinks.Location.wrap(`#${chartName}`), Turbolinks.uuid())
var gOptions = {
rollPeriod: 1
}
Expand Down

0 comments on commit ce5e93c

Please sign in to comment.