From e458ee1a0dfed2477b7398c9fb01d23f2910c294 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 30 Apr 2017 00:05:00 -0400 Subject: [PATCH] fix: Page contents block doesn't stick until end of page --- client/js/app.js | 4 ++-- package.json | 2 +- server/views/pages/view.pug | 5 +++-- yarn.lock | 16 +++++++++------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/client/js/app.js b/client/js/app.js index 941b8253..4a95185f 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -7,7 +7,7 @@ import _ from 'lodash' import io from 'socket.io-client' import Alerts from './components/alerts.js' import 'jquery-smooth-scroll' -import Sticky from 'sticky-js' +import 'jquery-sticky' $(() => { // ==================================== @@ -19,7 +19,7 @@ $(() => { offset: -70 }) - var sticky = new Sticky('.stickyscroll') // eslint-disable-line no-unused-vars + $('.stickyscroll').sticky({ topSpacing: 15 }) // ==================================== // Notifications diff --git a/package.json b/package.json index 7e240c29..34c0662b 100644 --- a/package.json +++ b/package.json @@ -139,13 +139,13 @@ "jquery-contextmenu": "^2.4.4", "jquery-simple-upload": "^1.0.0", "jquery-smooth-scroll": "^2.1.2", + "jquery-sticky": "^1.0.4", "mathjax": "^2.7.1", "node-sass": "latest", "nodemon": "latest", "pug-lint": "latest", "snyk": "latest", "standard": "latest", - "sticky-js": "^1.2.0", "twemoji-awesome": "^1.0.6", "uglify-js": "latest", "vee-validate": "^2.0.0-beta.25", diff --git a/server/views/pages/view.pug b/server/views/pages/view.pug index 60ad251c..a87ecbb1 100644 --- a/server/views/pages/view.pug +++ b/server/views/pages/view.pug @@ -61,11 +61,12 @@ block content a(href='/login') i.icon-unlock span Login - aside.stickyscroll(data-margin-top=15) + aside.stickyscroll .sidebar-label span Page Contents ul.sidebar-menu - li: a(href='#root', title='Top of Page') Top of Page + li: a(href='#root', title='Top of Page') + i.icon-arrow-up2 +tocMenu(pageData.tree) .column diff --git a/yarn.lock b/yarn.lock index 9e4d9798..040cfa03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1653,7 +1653,7 @@ debug-log@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" -debug@*, debug@2.6.4, debug@^2.3.2, debug@^2.6, debug@^2.6.3: +debug@*, debug@2.6.4, debug@^2.6, debug@^2.6.3: version "2.6.4" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" dependencies: @@ -1677,7 +1677,7 @@ debug@2.6.1: dependencies: ms "0.7.2" -debug@2.6.3, debug@^2.1.1, debug@^2.2.0, debug@^2.4.5: +debug@2.6.3, debug@^2.1.1, debug@^2.2.0, debug@^2.3.2, debug@^2.4.5: version "2.6.3" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: @@ -3721,7 +3721,13 @@ jquery-smooth-scroll@^2.1.2: dependencies: jquery ">=1.7.0" -jquery@>=1.7.0, jquery@^3.2.1: +jquery-sticky@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/jquery-sticky/-/jquery-sticky-1.0.4.tgz#2fe8d03dc904685340daa12cbdd1ca0c921b09ac" + dependencies: + jquery "*" + +jquery@*, jquery@>=1.7.0, jquery@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787" @@ -6440,10 +6446,6 @@ stdout-stream@^1.4.0: dependencies: readable-stream "^2.0.1" -sticky-js@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/sticky-js/-/sticky-js-1.2.0.tgz#da54ece034cc906646fca8c36bc7b5f48eec55e2" - stopword@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/stopword/-/stopword-0.1.1.tgz#d8858310a93d99fe86d30341a5bda7c6f60d8e65"