How to use the tui-code-snippet.CustomEvents function in tui-code-snippet

To help you get started, weโ€™ve selected a few tui-code-snippet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nhn / tui.chart / test / components / series / series.spec.js View on Github external
beforeEach(() => {
        series = new Series({
            chartType: 'bar',
            tooltipPrefix: 'tooltip-prefix-',
            theme: {
                label: {
                    fontFamily: 'Verdana',
                    fontSize: 11,
                    fontWeight: 'normal'
                },
                colors: ['blue']
            },
            options: {},
            eventBus: new snippet.CustomEvents()
        });
    });
github nhn / tui.chart / test / components / series / scatterChartSeries.spec.js View on Github external
beforeEach(() => {
        series = new scatterSeriesFactory.ScatterChartSeries({
            chartType: 'scatter',
            theme: {
                label: {
                    fontFamily: 'Verdana',
                    fontSize: 11
                }
            },
            options: {},
            eventBus: new snippet.CustomEvents()
        });

        series.layout = {
            position: {
                left: 0,
                top: 0
            }
        };
    });
github nhn / tui.chart / test / components / mouseEventDetectors / groupTypeEventDetector.spec.js View on Github external
beforeEach(() => {
        eventBus = new snippet.CustomEvents();
        tickBaseCoordinateModel = jasmine.createSpyObj('tickBaseCoordinateModel', ['makeRange']);
        tickBaseCoordinateModel.data = [{}, {}, {}];
        groupTypeEventDetector = new GroupTypeEventDetector({
            chartType: 'chartType',
            eventBus
        });
        groupTypeEventDetector.dimension = {width: 100, height: 100};
        groupTypeEventDetector.layout = {
            position: {top: 30, left: 40}
        };
        groupTypeEventDetector.tickBaseCoordinateModel = tickBaseCoordinateModel;
    });
github nhn / tui.chart / test / components / series / bulletChartSeries.spec.js View on Github external
beforeEach(() => {
        series = new barSeriesFactory.BulletChartSeries({
            chartType: 'bullet',
            theme: {},
            options: {},
            eventBus: new snippet.CustomEvents()
        });
        series.layout = {
            dimension: {
                width: 300,
                height: 400
            },
            position: {
                top: 50,
                left: 100
            }
        };

        seriesDataModel = new SeriesDataModel();
        dataProcessor = jasmine.createSpyObj('dataProcessor', ['getSeriesDataModel']);
        dataProcessor.getSeriesDataModel.and.returnValue(seriesDataModel);
        series.dataProcessor = dataProcessor;
github nhn / tui.calendar / src / js / handler / allday / creation.js View on Github external
if (!this.checkExpectedCondition(clickEventData.target)) {
        return;
    }

    getScheduleDataFunc = this._retriveScheduleData(this.alldayView, clickEventData);
    scheduleData = getScheduleDataFunc(clickEventData);

    this.fire('alldayCreationClick', scheduleData);

    this._createSchedule(scheduleData);

    this._requestOnClick = false;
};

common.mixin(alldayCore, AlldayCreation);
util.CustomEvents.mixin(AlldayCreation);

module.exports = AlldayCreation;
github nhn / tui.date-picker / src / js / datepicker / index.js View on Github external
this._calendar
        = this._timePicker
        = this._datepickerInput
        = this._container
        = this._element
        = this._date
        = this._rangeModel
        = this._openers
        = this._isEnabled
        = this._id
        = null;
    }
  }
);

snippet.CustomEvents.mixin(DatePicker);
module.exports = DatePicker;
github nhn / tui.calendar / src / js / view / view.js View on Github external
* @param {string} [className] - if supplied then return prefix added class name
 * @returns {string} CSS prefix value
 */
View.prototype.cssprefix = function(className) {
    return this.cssPrefix + (className || '');
};

/**
 * set state
 * @param {object} state - state
 */
View.prototype.setState = function(state) {
    util.extend(this.state, state);
};

util.CustomEvents.mixin(View);

module.exports = View;
github nhn / tui.file-uploader / src / js / view / drag.js View on Github external
* @private
     */
    _enable: function() {
        this.$el.addClass(this._enableClass);
    },

    /**
     * Disable droponze
     * @private
     */
    _disable: function() {
        this.$el.removeClass(this._enableClass);
    }
});

snippet.CustomEvents.mixin(DragAndDrop);

module.exports = DragAndDrop;
github nhn / tui.calendar / src / js / handler / month / resize.js View on Github external
}
    }

    /**
     * @event {MonthResize#monthResizeDragend}
     * @type {object}
     * @property {number} x - x index
     * @property {number} y - y index
     * @property {Date} date - drag date
     */
    this.fire('monthResizeDragend', scheduleData);

    this.getScheduleData = this._cache = null;
};

util.CustomEvents.mixin(MonthResize);

module.exports = MonthResize;
github nhn / tui.calendar / src / js / handler / allday / move.js View on Github external
* @param {object} clickEventData - Drag#Click event handler data.
 */
AlldayMove.prototype._onClick = function(clickEventData) {
    /**
     * @event AlldayMove#alldayMoveClick
     * @type {object}
     * @property {AlldayView} relatedView - allday view instance.
     * @property {number} datesInRange - date count of this view.
     * @property {number} dragStartXIndex - index number of dragstart grid index.
     * @property {number} xIndex - index number of mouse positions.
     */
    this._onDragEnd(clickEventData, 'alldayMoveClick', true);
};

common.mixin(AlldayCore, AlldayMove);
util.CustomEvents.mixin(AlldayMove);

module.exports = AlldayMove;