diff options
| author | Simon Knox <psimyn@gmail.com> | 2018-02-07 20:05:38 +1100 |
|---|---|---|
| committer | Simon Knox <psimyn@gmail.com> | 2018-02-07 20:05:38 +1100 |
| commit | 4e91d397833eb10e9eb64a48387c441be2922dfb (patch) | |
| tree | 079cbe95e6b0ac773987dd2ccedb98b1ded9681b /app/assets/javascripts/pager.js | |
| parent | b68e473e7bb2b64e1a36c54f9ced10ffe5a96763 (diff) | |
| parent | 4457cf9d178dc9912fd9c16427ad81b389179d00 (diff) | |
| download | gitlab-ce-snake-case.tar.gz | |
Merge branch 'master' into snake-casesnake-case
Diffstat (limited to 'app/assets/javascripts/pager.js')
| -rw-r--r-- | app/assets/javascripts/pager.js | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/app/assets/javascripts/pager.js b/app/assets/javascripts/pager.js index 6552a88b606..fd3105b1960 100644 --- a/app/assets/javascripts/pager.js +++ b/app/assets/javascripts/pager.js @@ -1,4 +1,5 @@ import { getParameterByName } from '~/lib/utils/common_utils'; +import axios from './lib/utils/axios_utils'; import { removeParams } from './lib/utils/url_utility'; const ENDLESS_SCROLL_BOTTOM_PX = 400; @@ -22,24 +23,22 @@ export default { getOld() { this.loading.show(); - $.ajax({ - type: 'GET', - url: this.url, - data: `limit=${this.limit}&offset=${this.offset}`, - dataType: 'json', - error: () => this.loading.hide(), - success: (data) => { - this.append(data.count, this.prepareData(data.html)); - this.callback(); - - // keep loading until we've filled the viewport height - if (!this.disable && !this.isScrollable()) { - this.getOld(); - } else { - this.loading.hide(); - } + axios.get(this.url, { + params: { + limit: this.limit, + offset: this.offset, }, - }); + }).then(({ data }) => { + this.append(data.count, this.prepareData(data.html)); + this.callback(); + + // keep loading until we've filled the viewport height + if (!this.disable && !this.isScrollable()) { + this.getOld(); + } else { + this.loading.hide(); + } + }).catch(() => this.loading.hide()); }, append(count, html) { |
