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

site: set zoom buttons in DepthChart ctor #1799

Merged
merged 1 commit into from
Aug 19, 2022
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
2 changes: 1 addition & 1 deletion client/webserver/site/src/html/bodybuilder.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=GHTDEG56"></script>
<script src="/js/entry.js?v=YKVNRn4"></script>
</body>
</html>
{{end}}
Expand Down
8 changes: 1 addition & 7 deletions client/webserver/site/src/js/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ class Chart {
this.ctx = ctx
this.ctx.textAlign = 'center'
this.ctx.textBaseline = 'middle'
this.setZoomBttns()
// Mouse handling
this.mousePos = null
bind(this.canvas, 'mousemove', (e: MouseEvent) => {
Expand Down Expand Up @@ -206,12 +205,6 @@ class Chart {
this.render()
}

// setZoomBttns is run before drawing and should be used for setup of zoom
// buttons.
setZoomBttns () {
// should be implemented by inheriting class.
}

/* click is the handler for a click event on the canvas. */
click (e: MouseEvent) {
this.report.click(e)
Expand Down Expand Up @@ -410,6 +403,7 @@ export class DepthChart extends Chart {
buys: [],
sells: []
}
this.setZoomBttns() // can't wait for requestAnimationFrame -> resized
this.resize(parent.clientHeight)
}

Expand Down
10 changes: 6 additions & 4 deletions client/webserver/site/src/js/markets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@ export default class MarketsPage extends BasePage {
ws.registerRoute(updateRemainingRoute, (data: BookUpdate) => { this.handleUpdateRemainingRoute(data) })
// Handle the new order for the order book on the 'epoch_order' route.
ws.registerRoute(epochOrderRoute, (data: BookUpdate) => { this.handleEpochOrderRoute(data) })
// Handle the intial candlestick data on the 'candles' route.
ws.registerRoute(candleUpdateRoute, (data: BookUpdate) => { this.handleCandleUpdateRoute(data) })
// Handle the candles update on the 'candles' route.
// Handle the initial candlestick data on the 'candles' route.
ws.registerRoute(candlesRoute, (data: BookUpdate) => { this.handleCandlesRoute(data) })
// Handle the candles update on the 'candles' route.
ws.registerRoute(candleUpdateRoute, (data: BookUpdate) => { this.handleCandleUpdateRoute(data) })

// Bind the wallet unlock form.
this.unlockForm = new UnlockWalletForm(page.unlockWalletForm, async () => { this.openFunc() })
// Create a wallet
Expand Down Expand Up @@ -2221,9 +2222,10 @@ export default class MarketsPage extends BasePage {
unload () {
ws.request(unmarketRoute, {})
ws.deregisterRoute(bookRoute)
ws.deregisterRoute(epochOrderRoute)
ws.deregisterRoute(bookOrderRoute)
ws.deregisterRoute(unbookOrderRoute)
ws.deregisterRoute(updateRemainingRoute)
ws.deregisterRoute(epochOrderRoute)
ws.deregisterRoute(candlesRoute)
ws.deregisterRoute(candleUpdateRoute)
this.depthChart.unattach()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=GHTDEG56"></script>
<script src="/js/entry.js?v=YKVNRn4"></script>
</body>
</html>
{{end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=GHTDEG56"></script>
<script src="/js/entry.js?v=YKVNRn4"></script>
</body>
</html>
{{end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=GHTDEG56"></script>
<script src="/js/entry.js?v=YKVNRn4"></script>
</body>
</html>
{{end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
{{end}}

{{define "bottom"}}
<script src="/js/entry.js?v=GHTDEG56"></script>
<script src="/js/entry.js?v=YKVNRn4"></script>
</body>
</html>
{{end}}
Expand Down