diff options
author | Regis <boudinot.regis@yahoo.com> | 2017-01-09 10:20:20 -0700 |
---|---|---|
committer | Regis <boudinot.regis@yahoo.com> | 2017-01-09 10:20:20 -0700 |
commit | 5498448535c74e326dcb9a714dc3d8992c965f2c (patch) | |
tree | bba7c909db7b86e5a9a388d490d8efbe3ff64f92 | |
parent | 76c68d1a185009b831bab014446829158ced2f17 (diff) | |
download | gitlab-ce-5498448535c74e326dcb9a714dc3d8992c965f2c.tar.gz |
use Turbolinks instead of window.pushState for pagination
-rw-r--r-- | app/assets/javascripts/vue_pagination/index.js.es6 | 7 | ||||
-rw-r--r-- | app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 | 7 |
2 files changed, 4 insertions, 10 deletions
diff --git a/app/assets/javascripts/vue_pagination/index.js.es6 b/app/assets/javascripts/vue_pagination/index.js.es6 index b9678d8a97f..78a26f65dfd 100644 --- a/app/assets/javascripts/vue_pagination/index.js.es6 +++ b/app/assets/javascripts/vue_pagination/index.js.es6 @@ -17,15 +17,12 @@ /** 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: change(pagenum, apiScope) { - window.history.pushState({}, null, `?scope=${apiScope}&p=${pagenum}`); - clearInterval(this.timeLoopInterval); - this.pageRequest = true; - this.store.fetchDataLoop.call(this, Vue, pagenum, this.scope, apiScope); + Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`); }, */ diff --git a/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 b/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 index eb9035146ba..73627e9ba50 100644 --- a/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/pipelines.js.es6 @@ -1,4 +1,4 @@ -/* global Vue, gl */ +/* global Vue, Turbolinks, gl */ /* eslint-disable no-param-reassign */ ((gl) => { @@ -36,10 +36,7 @@ }, methods: { change(pagenum, apiScope) { - window.history.pushState({}, null, `?scope=${apiScope}&p=${pagenum}`); - clearInterval(this.timeLoopInterval); - this.pageRequest = true; - this.store.fetchDataLoop.call(this, Vue, pagenum, this.scope, apiScope); + Turbolinks.visit(`?scope=${apiScope}&p=${pagenum}`); }, author(pipeline) { if (!pipeline.commit) return { avatar_url: '', web_url: '', username: '' }; |