diff --git a/client/webserver/site/src/html/bodybuilder.tmpl b/client/webserver/site/src/html/bodybuilder.tmpl index 01b2bada5b..6bcf25f9fa 100644 --- a/client/webserver/site/src/html/bodybuilder.tmpl +++ b/client/webserver/site/src/html/bodybuilder.tmpl @@ -85,7 +85,7 @@ {{end}} {{define "bottom"}} - + {{end}} diff --git a/client/webserver/site/src/js/charts.ts b/client/webserver/site/src/js/charts.ts index d04e0eac4a..59902d2909 100644 --- a/client/webserver/site/src/js/charts.ts +++ b/client/webserver/site/src/js/charts.ts @@ -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) => { @@ -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) @@ -410,6 +403,7 @@ export class DepthChart extends Chart { buys: [], sells: [] } + this.setZoomBttns() // can't wait for requestAnimationFrame -> resized this.resize(parent.clientHeight) } @@ -1207,6 +1201,7 @@ function makeLabels ( valFmt = valFmt || formatLabelValue const n = screenW / spacingGuess const diff = max - min + if (n < 1 || diff <= 0) return { lbls: [] } const tickGuess = diff / n // make the tick spacing a multiple of the step const tick = tickGuess + step - (tickGuess % step) diff --git a/client/webserver/site/src/js/markets.ts b/client/webserver/site/src/js/markets.ts index 36a34e2755..0dcad62254 100644 --- a/client/webserver/site/src/js/markets.ts +++ b/client/webserver/site/src/js/markets.ts @@ -322,10 +322,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 @@ -2205,9 +2206,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() diff --git a/client/webserver/site/src/localized_html/en-US/bodybuilder.tmpl b/client/webserver/site/src/localized_html/en-US/bodybuilder.tmpl index 6d0566dee8..c07b836cdd 100644 --- a/client/webserver/site/src/localized_html/en-US/bodybuilder.tmpl +++ b/client/webserver/site/src/localized_html/en-US/bodybuilder.tmpl @@ -85,7 +85,7 @@ {{end}} {{define "bottom"}} - + {{end}} diff --git a/client/webserver/site/src/localized_html/pl-PL/bodybuilder.tmpl b/client/webserver/site/src/localized_html/pl-PL/bodybuilder.tmpl index f5112f7d82..3b58ea17d5 100644 --- a/client/webserver/site/src/localized_html/pl-PL/bodybuilder.tmpl +++ b/client/webserver/site/src/localized_html/pl-PL/bodybuilder.tmpl @@ -85,7 +85,7 @@ {{end}} {{define "bottom"}} - + {{end}} diff --git a/client/webserver/site/src/localized_html/pt-BR/bodybuilder.tmpl b/client/webserver/site/src/localized_html/pt-BR/bodybuilder.tmpl index 475a7e2f7c..c41b75bdb7 100644 --- a/client/webserver/site/src/localized_html/pt-BR/bodybuilder.tmpl +++ b/client/webserver/site/src/localized_html/pt-BR/bodybuilder.tmpl @@ -85,7 +85,7 @@ {{end}} {{define "bottom"}} - + {{end}} diff --git a/client/webserver/site/src/localized_html/zh-CN/bodybuilder.tmpl b/client/webserver/site/src/localized_html/zh-CN/bodybuilder.tmpl index d921600275..f628d1afd8 100644 --- a/client/webserver/site/src/localized_html/zh-CN/bodybuilder.tmpl +++ b/client/webserver/site/src/localized_html/zh-CN/bodybuilder.tmpl @@ -85,7 +85,7 @@ {{end}} {{define "bottom"}} - + {{end}}