whychdw
2019-09-09 c0b9ce437d409b89ca0e5388344ca9c5a56d70a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/**
 *
 *  (c) 2010-2018 Paweł Fus
 *
 *  License: www.highcharts.com/license
 *
 *  !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
 *
 * */
'use strict';
 
Object.defineProperty(exports, "__esModule", {
    value: true
});
var chartNavigation = {
    /**
     * Initializes `chart.navigation` object which delegates `update()` methods
     * to all other common classes (used in exporting and navigationBindings).
     *
     * @private
     * @param {Highcharts.Chart} chart
     *        The chart instance.
     * @return {void}
     */
    initUpdate: function initUpdate(chart) {
        if (!chart.navigation) {
            chart.navigation = {
                updates: [],
                update: function update(options, redraw) {
                    this.updates.forEach(function (updateConfig) {
                        updateConfig.update.call(updateConfig.context, options, redraw);
                    });
                }
            };
        }
    },
    /**
     * Registers an `update()` method in the `chart.navigation` object.
     *
     * @private
     * @param {Highcharts.ChartNavigationUpdateFunction} update
     *        The `update()` method that will be called in `chart.update()`.
     * @param {Highcharts.Chart} chart
     *        The chart instance. `update()` will use that as a context
     *        (`this`).
     * @return {void}
     */
    addUpdate: function addUpdate(update, chart) {
        if (!chart.navigation) {
            this.initUpdate(chart);
        }
        chart.navigation.updates.push({
            update: update,
            context: chart
        });
    }
};
exports.default = chartNavigation;