Skip to content

Commit 22a5d86

Browse files
Move highstock to app
1 parent 8930bee commit 22a5d86

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

src/javascript/_common/common_functions.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@ const getSetElementValue = (element, text, type) => { // eslint-disable-line con
8282
}
8383
};
8484

85-
const requireHighstock = callback => (
86-
require.ensure([], (require) => {
87-
const Highstock = require('highstock-release');
88-
return callback(Highstock);
89-
}, 'highstock')
90-
);
91-
9285
/*
9386
* @param {String} id_selector the selector for the element
9487
* @param {Element} parent optional selector to use for parent, defaults to document
@@ -112,7 +105,6 @@ module.exports = {
112105
checkInput,
113106
dateValueChanged,
114107
selectorExists,
115-
requireHighstock,
116108
getElementById,
117109
getVisibleElement,
118110
elementTextContent: (element, text) => getSetElementValue(element, text, 'textContent'),

src/javascript/app/pages/trade/charts/digit_info.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const CreateDropdown = require('@binary-com/binary-style').selectDropdown;
2-
const Symbols = require('../symbols');
3-
const BinarySocket = require('../../../base/socket');
4-
const getHighstock = require('../../../../_common/common_functions').requireHighstock;
5-
const localize = require('../../../../_common/localize').localize;
1+
const CreateDropdown = require('@binary-com/binary-style').selectDropdown;
2+
const getHighstock = require('../common').requireHighstock;
3+
const Symbols = require('../symbols');
4+
const BinarySocket = require('../../../base/socket');
5+
const localize = require('../../../../_common/localize').localize;
66

77
const DigitInfo = (() => {
88
let spots = [];

src/javascript/app/pages/trade/charts/highchart.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const HighchartUI = require('./highchart.ui');
2+
const getHighstock = require('../common').requireHighstock;
23
const MBContract = require('../../mb_trade/mb_contract');
34
const MBDefaults = require('../../mb_trade/mb_defaults');
45
const Defaults = require('../../trade/defaults');
@@ -8,7 +9,6 @@ const ViewPopupUI = require('../../user/view_popup/view_popup.ui');
89
const isJPClient = require('../../../base/client').isJPClient;
910
const BinarySocket = require('../../../base/socket');
1011
const addComma = require('../../../common/currency').addComma;
11-
const getHighstock = require('../../../../_common/common_functions').requireHighstock;
1212
const localize = require('../../../../_common/localize').localize;
1313
const State = require('../../../../_common/storage').State;
1414
const getPropertyValue = require('../../../../_common/utility').getPropertyValue;

src/javascript/app/pages/trade/common.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ const commonTrading = (() => {
376376
return true;
377377
};
378378

379+
const requireHighstock = callback => (
380+
require.ensure([], (require) => {
381+
const Highstock = require('highstock-release');
382+
return callback(Highstock);
383+
}, 'highstock')
384+
);
385+
379386
return {
380387
getFormNameBarrierCategory,
381388
contractTypeDisplayMapping,
@@ -395,6 +402,7 @@ const commonTrading = (() => {
395402
displayContractForms,
396403
displayMarkets,
397404
timeIsValid,
405+
requireHighstock,
398406
showPriceOverlay: () => { showHideOverlay('loading_container2', 'block'); },
399407
hidePriceOverlay: () => { showHideOverlay('loading_container2', 'none'); },
400408
hideFormOverlay : () => { showHideOverlay('loading_container3', 'none'); },

src/javascript/app/pages/trade/tick_trade.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const moment = require('moment');
2+
const requireHighstock = require('./common').requireHighstock;
23
const Tick = require('./tick');
34
const updatePurchaseStatus = require('./update_values').updatePurchaseStatus;
45
const ViewPopupUI = require('../user/view_popup/view_popup.ui');
@@ -66,7 +67,7 @@ const TickDisplay = (() => {
6667
const end_time = parseInt(data.contract_start) + parseInt((number_of_ticks + 2) * 5);
6768

6869
setXIndicators();
69-
CommonFunctions.requireHighstock((Highstock) => {
70+
requireHighstock((Highstock) => {
7071
Highcharts = Highstock;
7172
initializeChart({
7273
minimize,

0 commit comments

Comments
 (0)