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

Jordan/1572 scroll bug #1757

Merged
merged 2 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1667](https://github.com/cosmos/voyager/issues/1667) Fixed menu in PageSend + hover cursor for menu @sabau
- [\#1676](https://github.com/cosmos/voyager/issues/1676) Reduced minWidth css for ModalVote to have 2 buttons per line @sabau
- [\#1676](https://github.com/cosmos/voyager/issues/1670) Update balance in header after voting and depositing @faboweb
- [\#1572](https://github.com/cosmos/voyager/issues/1572) Fixed scroll bug when switching between tabs @jbibla

## [0.10.7] - 2018-10-10

Expand Down
7 changes: 7 additions & 0 deletions app/src/renderer/components/governance/PageGovernance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import { mapGetters } from "vuex"
import DataEmptySearch from "common/TmDataEmptySearch"
import ModalSearch from "common/TmModalSearch"
import PerfectScrollbar from "perfect-scrollbar"
import ModalPropose from "./ModalPropose"
import ToolBar from "common/ToolBar"
import TmBalance from "common/TmBalance"
Expand Down Expand Up @@ -66,6 +67,12 @@ export default {
// TODO: get min deposit denom from gov params
...mapGetters([`proposals`, `filters`, `bondingDenom`, `connected`])
},
mounted() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about putting this logic into TmPage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know 😞... but i want to get rid of TmPage and also only should run where tabs are present (not on wallet, transactions, or preferences). also, after we bring tendermint-ui into voyager this kind of thing will be easier / more obvious.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's an issue for it on #1391

this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))
},
updated() {
this.$el.querySelector(`.tm-page-main`).scrollTop = 0
},
methods: {
onPropose() {
this.showModalPropose = true
Expand Down
8 changes: 7 additions & 1 deletion app/src/renderer/components/staking/PageStaking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { mapGetters, mapActions } from "vuex"
import Mousetrap from "mousetrap"
import { TmPage } from "@tendermint/ui"
import ModalSearch from "common/TmModalSearch"
import PerfectScrollbar from "perfect-scrollbar"
import ToolBar from "common/ToolBar"
import TmBalance from "common/TmBalance"
export default {
Expand Down Expand Up @@ -53,13 +54,18 @@ export default {
computed: {
...mapGetters([`connected`, `delegates`, `filters`])
},
async mounted() {
mounted() {
this.ps = new PerfectScrollbar(this.$el.querySelector(`.tm-page-main`))

Mousetrap.bind([`command+f`, `ctrl+f`], () => this.setSearch(true))
Mousetrap.bind(`esc`, () => this.setSearch(false))

// XXX temporary because querying the shares shows old shares after bonding
// this.updateDelegates()
},
updated() {
this.$el.querySelector(`.tm-page-main`).scrollTop = 0
},
methods: {
setSearch(bool = !this.filters[`delegates`].search.visible) {
this.$store.commit(`setSearchVisible`, [`delegates`, bool])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports[`PageGovernance disables proposal creation if not connected 1`] = `
</menu>
</div>
</header>
<main class=\\"tm-page-main\\">
<main class=\\"tm-page-main ps\\">
<!---->
<!---->
<div class=\\"tm-page\\" data-title=\\"Wallet\\">
Expand Down Expand Up @@ -134,6 +134,12 @@ exports[`PageGovernance disables proposal creation if not connected 1`] = `
</div>
</main>
</div>
<div class=\\"ps__rail-x\\" style=\\"left: 0px; top: 0px;\\">
<div class=\\"ps__thumb-x\\" tabindex=\\"0\\" style=\\"left: 0px; width: 0px;\\"></div>
</div>
<div class=\\"ps__rail-y\\" style=\\"top: 0px; left: 0px;\\">
<div class=\\"ps__thumb-y\\" tabindex=\\"0\\" style=\\"top: 0px; height: 0px;\\"></div>
</div>
</main>
</div>"
`;
Expand Down Expand Up @@ -278,6 +284,12 @@ exports[`PageGovernance has the expected html structure 1`] = `
<div class=\\"ps__rail-y\\" style=\\"top: 0px; left: 0px;\\">
<div class=\\"ps__thumb-y\\" tabindex=\\"0\\" style=\\"top: 0px; height: 0px;\\"></div>
</div>
<div class=\\"ps__rail-x\\" style=\\"left: 0px; top: 0px;\\">
<div class=\\"ps__thumb-x\\" tabindex=\\"0\\" style=\\"left: 0px; width: 0px;\\"></div>
</div>
<div class=\\"ps__rail-y\\" style=\\"top: 0px; left: 0px;\\">
<div class=\\"ps__thumb-y\\" tabindex=\\"0\\" style=\\"top: 0px; height: 0px;\\"></div>
</div>
</main>
</div>"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ exports[`PageStaking has the expected html structure 1`] = `
<div class=\\"ps__rail-y\\" style=\\"top: 0px; left: 0px;\\">
<div class=\\"ps__thumb-y\\" tabindex=\\"0\\" style=\\"top: 0px; height: 0px;\\"></div>
</div>
<div class=\\"ps__rail-x\\" style=\\"left: 0px; top: 0px;\\">
<div class=\\"ps__thumb-x\\" tabindex=\\"0\\" style=\\"left: 0px; width: 0px;\\"></div>
</div>
<div class=\\"ps__rail-y\\" style=\\"top: 0px; left: 0px;\\">
<div class=\\"ps__thumb-y\\" tabindex=\\"0\\" style=\\"top: 0px; height: 0px;\\"></div>
</div>
</main>
</div>"
`;