Commit graph

9 commits

Author SHA1 Message Date
Kevin Ansfield ff51925567
Fixed sticky title and author hover JS (#629)
no issue

- replaces author hover JS that was lost during merge
- replaces `floating-header.js` with `sticky-nav-title.js` containing the relevant JS that was lost during merge with a cleanup for unused variables and unnecessary event listeners
- removes reference to non-existent `{{> floating-header}}` partial
2019-10-21 10:02:05 +01:00
Kevin Ansfield 978ffe0eb6
Concatenated all JS into a single file (#624)
no issue

- moved large inline JS from templates into separate JS files
  - floating header
  - gallery card support
- use `gulp-concat` to concatenate all JS files into a single `built/casper.js` file
- reduces external JS file requests from 3 (jquery, infinite-scroll.js, jquery.fitvids.js) down to 2 (jquery, casper.js) and reduces page size by removing repeated inline code
2019-10-20 15:55:06 +02:00
汪磊 3c2347c7f9 🎨 Optimised infinite scroll (#503)
no issue
- removed jQuery usage
- use the `<link rel="next">` tag provided by Ghost to determine the next page to fetch
2018-12-05 12:38:11 +00:00
Aileen Nowak d5002f2c51 🐛 Fixed infinitescroll when a paged url is loaded directly (#447)
closes #445
- added an fn to sanitize the pathname, that might include a pagination url
- fixed an issue, where the request would still be made if the current page is bigger than max pages
- added comments
2018-04-10 10:04:43 +01:00
Kevin Ansfield 41bcbb7157 💨 Infinite scroll perf improvements
no issue
- swap jQuery HTML parsing and insertion for pure DOM
- remove fade animation
- increase buffer by 100px so next page request happens sooner
2018-04-09 11:03:48 +01:00
Aileen Nowak 8690450eae 🎣 Infinite scroll: no API request on last page
no issue

Brings back a little safety guard: when the current page is also the last page, don't make an API request to the server.
2017-07-11 12:32:58 +07:00
Kevin Ansfield 0f9410fb3d 💄 refactor infinite scroll (#325)
closes #321, closes #323
- use `requestAnimationFrame` and related techniques to minimise scroll processing
- add an `isLoading` guard to ensure we don't try to process anything until the next page has been loaded+inserted
- check for a 404 as an indication we've loaded as many pages as possible at which point the scroll behaviour is removed
- sanitize `window.location.pathname` to remove hash params and any double-slashes that may result
- add a 100px buffer from the bottom of the screen so that it's not necessary to exactly hit the bottom before infinite loading is triggered
2017-07-10 19:53:42 +07:00
汪磊 d3a9af0666 Remove infinitescroll in single page (#319)
* Remove infinitescroll in single page

* Update infinitescroll.js
2017-06-27 18:03:51 +07:00
Aileen Nowak 0914d43a86 💄 Infinite scroll (#316)
* 💄  Infinite scroll

closes #314

Adds infinite scroll logic to Casper 2.0

* use jquery min and not slim
2017-06-21 13:10:09 +01:00