diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-11-29 18:24:11 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-12-04 11:17:23 +0000 |
| commit | 78a30d44cf8f1ce0d4d3fc53481a87eebeaea088 (patch) | |
| tree | 998def9a2fa63f84167501960dca2c30d2c3ec44 /addons/web_unsplash/static/src/js/unsplashapi.js | |
| parent | 1f847a1e2eed63086448ceb451bd1a2f87c8c641 (diff) | |
[REF] web_editor, web_unsplash: review load more feature
* Simplify the code
* Make the feature mork without unsplash
* Handle corner cases
task-1896705
Diffstat (limited to 'addons/web_unsplash/static/src/js/unsplashapi.js')
| -rw-r--r-- | addons/web_unsplash/static/src/js/unsplashapi.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/addons/web_unsplash/static/src/js/unsplashapi.js b/addons/web_unsplash/static/src/js/unsplashapi.js index a6ec5b75324..3055ec306e8 100644 --- a/addons/web_unsplash/static/src/js/unsplashapi.js +++ b/addons/web_unsplash/static/src/js/unsplashapi.js @@ -27,12 +27,11 @@ var UnsplashCore = Class.extend(Mixins.EventDispatcherMixin, ServicesMixin, { * * @param {String} query search terms * @param {Integer} pageSize number of image to display per page - * @param {Integer} pageNumber page number to retrieve */ - getImages: function (query, pageSize, pageNumber) { + getImages: function (query, pageSize) { var self = this; - var to = pageSize * pageNumber; - var from = to - pageSize; + var from = 0; + var to = pageSize; var cachedData = this._cache[query]; if (cachedData && (cachedData.images.length >= to || (cachedData.totalImages !== 0 && cachedData.totalImages < to))) { |
