Fix turbo nav for settings and stats pages.
Extract settings.js, preserve inline scripts from raw HTML (DOMParser strips them), and load trade config via JSON script tag. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -227,14 +227,14 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block extra_js %}
|
||||
<script>
|
||||
window.TRADE_SIZING_MODE = {{ sizing_mode|tojson }};
|
||||
window.MARKET_NAV_ENABLED = {{ nav_items.market|tojson }};
|
||||
window.TRADE_FIXED_LOTS = {{ fixed_lots|tojson }};
|
||||
window.TRADE_FIXED_AMOUNT = {{ fixed_amount|tojson }};
|
||||
window.PRODUCT_CATEGORIES = {{ product_categories | default([]) | tojson }};
|
||||
window.__RECOMMEND_ROWS__ = {{ recommend_rows | default([]) | tojson }};
|
||||
window.CTP_AUTO_CONNECT = {{ ctp_auto_connect | tojson }};
|
||||
</script>
|
||||
<script type="application/json" id="trade-page-data">{{ {
|
||||
'sizing_mode': sizing_mode,
|
||||
'market_nav_enabled': nav_items.market,
|
||||
'fixed_lots': fixed_lots,
|
||||
'fixed_amount': fixed_amount,
|
||||
'product_categories': product_categories | default([]),
|
||||
'recommend_rows': recommend_rows | default([]),
|
||||
'ctp_auto_connect': ctp_auto_connect
|
||||
} | tojson }}</script>
|
||||
<script src="{{ url_for('static', filename='js/trade.js') }}?v={{ asset_v }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user