Commit 54984485 authored by Regis's avatar Regis

use Turbolinks instead of window.pushState for pagination

parent 76c68d1a
...@@ -17,15 +17,12 @@ ...@@ -17,15 +17,12 @@
/** /**
This function will take the information given by the pagination component This function will take the information given by the pagination component
And make a new API call from the parent And make a new Turbolinks call
Here is an example `change` method: Here is an example `change` method:
change(pagenum, apiScope) { change(pagenum, apiScope) {
window.history.pushState({}, null, `?scope=${apiScope}&p=${pagenum}`); Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`);
clearInterval(this.timeLoopInterval);
this.pageRequest = true;
this.store.fetchDataLoop.call(this, Vue, pagenum, this.scope, apiScope);
}, },
*/ */
......
/* global Vue, gl */ /* global Vue, Turbolinks, gl */
/* eslint-disable no-param-reassign */ /* eslint-disable no-param-reassign */
((gl) => { ((gl) => {
...@@ -36,10 +36,7 @@ ...@@ -36,10 +36,7 @@
}, },
methods: { methods: {
change(pagenum, apiScope) { change(pagenum, apiScope) {
window.history.pushState({}, null, `?scope=${apiScope}&p=${pagenum}`); Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`);
clearInterval(this.timeLoopInterval);
this.pageRequest = true;
this.store.fetchDataLoop.call(this, Vue, pagenum, this.scope, apiScope);
}, },
author(pipeline) { author(pipeline) {
if (!pipeline.commit) return { avatar_url: '', web_url: '', username: '' }; if (!pipeline.commit) return { avatar_url: '', web_url: '', username: '' };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment