Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change scroll top button to component #2170

Merged
merged 43 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4f3113c
[WIP] Comment off making ScrollToTopButton default
yucheng11122017 Feb 6, 2023
3d0fe19
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Feb 8, 2023
5371181
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Feb 15, 2023
74d5d1e
Make scrollToTopButton not default
yucheng11122017 Feb 15, 2023
4ff635b
Add scrollToButton component
yucheng11122017 Feb 15, 2023
b0002f8
Add scrollToTopButton to default and minimal layout
yucheng11122017 Feb 15, 2023
afba3e1
Add support for customising icon, icon color and icon size
yucheng11122017 Feb 15, 2023
3e08094
Add support for customised positioning
yucheng11122017 Feb 15, 2023
702cf7a
Add documentation for scrollToTopButton
yucheng11122017 Feb 15, 2023
31d4ee2
Remove unecessary div
yucheng11122017 Feb 15, 2023
8bf04a5
Add scrollToTopButton to documentation
yucheng11122017 Feb 15, 2023
b1354cf
Update test cases
yucheng11122017 Feb 15, 2023
6c2e81a
Delete scrollTopButton.js
yucheng11122017 Feb 15, 2023
4ed8ce8
Fix wrong backslash
yucheng11122017 Feb 15, 2023
45c5084
Rename scroll-to-top-button to scroll-top-button
yucheng11122017 Feb 15, 2023
ae7c309
Change scrollToTopButton to scrollTopButton
yucheng11122017 Feb 15, 2023
2589c23
Move CSS styles into scrollTopButton
yucheng11122017 Feb 17, 2023
2da7c94
Refactor code to use tenary statements
yucheng11122017 Feb 17, 2023
68bc5d5
Add test cases for scrollTopButton
yucheng11122017 Feb 17, 2023
e202741
Change iconSize in scrollTopButton to be the same as iconSize in box
yucheng11122017 Feb 17, 2023
f1b5e5c
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Feb 17, 2023
6297c58
Fix formatting for style in scrollTopButton
yucheng11122017 Feb 17, 2023
d3fda20
Change to use class instead of id for css style
yucheng11122017 Feb 17, 2023
7b2b8ee
Change icon to use slots
yucheng11122017 Feb 20, 2023
43c7716
Update UG to be consistent with box
yucheng11122017 Feb 20, 2023
b9cc694
Update test cases
yucheng11122017 Feb 20, 2023
d95b21c
Change default size to be lg
yucheng11122017 Feb 20, 2023
93c2565
Add indentation for slot
yucheng11122017 Feb 20, 2023
c536329
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Feb 22, 2023
cb7e279
Add test cases
yucheng11122017 Feb 23, 2023
43590e7
Fix indentation for slot
yucheng11122017 Feb 23, 2023
7e2bab8
Update test cases
yucheng11122017 Feb 23, 2023
9eb5a16
Update test case
yucheng11122017 Feb 23, 2023
e805bb9
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Mar 12, 2023
b8e76c7
Restore package-lock.json
yucheng11122017 Mar 12, 2023
7072690
Fix indentation
yucheng11122017 Mar 12, 2023
e93a5c3
Add instructions on removing scroll top button to UG
yucheng11122017 Mar 12, 2023
0d8a6e9
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Mar 16, 2023
f1fa775
Update test cases
yucheng11122017 Mar 16, 2023
5e67fe4
Revert "Add instructions on removing scroll top button to UG"
yucheng11122017 Mar 17, 2023
b923960
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Mar 17, 2023
d4b24d5
Update test cases
yucheng11122017 Mar 17, 2023
33401c4
Merge branch 'master' of https://github.com/MarkBind/markbind into co…
yucheng11122017 Mar 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_markbind/layouts/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<div id="content-wrapper">
{{ content }}
</div>
<scroll-top-button></scroll-top-button>
</div>

<include src="footers/footer.md" />
1 change: 1 addition & 0 deletions docs/_markbind/layouts/devGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<page-nav />
</div>
</nav>
<scroll-top-button></scroll-top-button>
</div>

<include src="footers/footer.md" />
1 change: 1 addition & 0 deletions docs/_markbind/layouts/userGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<page-nav />
</div>
</nav>
<scroll-top-button></scroll-top-button>
</div>

<include src="footers/footer.md" />
1 change: 1 addition & 0 deletions docs/userGuide/fullSyntaxReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
navBars : ['Nav Bars', ['navigation', 'reader-facing']],
siteNavigationMenus : ['Site Navigation Menus', ['navigation', 'reader-facing']],
pageNavigationMenus : ['Page Navigation Menus', ['navigation', 'reader-facing']],
scrollTopButton : ['Scroll To Top Button', ['navigation', 'reader-facing']],
questions : ['Questions and Quizzes', ['others', 'reader-facing']]
} %}

Expand Down
39 changes: 39 additions & 0 deletions docs/userGuide/syntax/scrollTopButton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{% from "userGuide/components/advanced.md" import slot_info_trigger %}

## Scroll To Top Button

<div id="content">

The ```scroll-top-button``` component allows users to move to the top of the page.

****Adding a scroll-top-button****

Add ```<scroll-top-button><scroll-top-button/>``` to layout file.

****Options****

| Name | Type | Default | Description |
|---------------------------|----------|-------------------------|-----------------------------------------------------------------------------------------------|
| icon{{slot_info_trigger}} | `String` | `:fas-arrow-circle-up:` | Inline MarkDown text of the icon displayed on the left. |
| icon-size | `String` | `lg` | Resizes the icon. Supports integer-scaling of the icon dimensions e.g. `2x`, `3x`, `4x`, etc. |
| bottom | `String` | `2%` | Distance from bottom edge of page. |
| right | `String` | `2%` | Distance from right edge of page. |

</div>

<div id="short">

```html
<scroll-top-button
icon=":fas-arrow-circle-up:"
icon-size="2x"
bottom="2%"
right="2%"
></scroll-top-button>
```
</div>

<div id="examples" class="d-none">

You can see an example of a scroll to top button on the ==on the bottom right side== of this page.
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<div class="nav-component slim-scroll">
<page-nav />
</div>
</nav>
</nav>
<scroll-top-button></scroll-top-button>
</div>

<include src="footers/footer.md" />
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<p>Repro:</p>
<p>Steps to Reproduce</p>
</div>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cli/test/functional/test_site/expected/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ <h6 class="always-index" id="level-6-header-outside-headingsearchindex-with-alwa
</ol>
</section>

<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
Expand Down Expand Up @@ -843,6 +842,7 @@ <h6 class="always-index" id="level-6-header-outside-headingsearchindex-with-alwa
</overlay-source>
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ <h2 id="feature-list"><span id="feature-list" class="anchor"></span>Feature list
<div id="image">
<img src="/test_site/sub_site/images/I'm not allowed to use my favorite tool.png">
</div>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<p><strong>baseUrl in a nested sub-site page's include should correctly evaluate to the nested sub-site</strong></p>
<p>The base url in the nested_sub_site page's include is /test_site/sub_site/nested_sub_site.</p>
</div>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<p><strong>Test {% import %}</strong></p>
<p>variable to import</p>
<hr>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<p><strong>Test {% import %}</strong></p>
<p>variable to import</p>
<hr>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ <h5 id="should-have-anchor-25"><span id="should-have-anchor-25" class="anchor"><
<h6 id="should-have-anchor-26"><span id="should-have-anchor-26" class="anchor"></span>should have anchor<a class="fa fa-anchor" href="#should-have-anchor-26" onclick="event.stopPropagation()"></a></h6>
</panel>
</div>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<a-point x="50%" y="50%" content="some test text" label="5" legend="both" header="some test text"></a-point>
<a-point x="75%" y="50%" content="some test text" label="6" legend="both" header="some test text"></a-point>
</annotate>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ <h3 id="testing-site-nav"><span id="testing-site-nav" class="anchor"></span>Test
<p><strong>Filler text</strong></p>
<p><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></p>
<p>Some text</p>
<i class="fa fa-arrow-circle-up fa-lg d-print-none" id="scroll-top-button" onclick="handleScrollTop()" aria-hidden="true"></i>
</div>
<overlay-source id="page-nav" tag-name="nav" to="page-nav">
<div class="nav-component slim-scroll">
</div>
</overlay-source>
<scroll-top-button></scroll-top-button>
</div>
<div>
<footer>
Expand Down
Loading