Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substitute util.bind with Function.bind #618

Merged
merged 1 commit into from Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/common/autoScroll.js
Expand Up @@ -148,7 +148,7 @@ AutoScroll.prototype._onMouseDown = function(mouseDownEvent) {
}

window.clearInterval(this._intervalID);
this._intervalID = window.setInterval(util.bind(this._onTick, this), SCROLL_INTERVAL);
this._intervalID = window.setInterval(this._onTick.bind(this), SCROLL_INTERVAL);

domevent.on(global, {
'mousemove': this._onMouseMove,
Expand Down
2 changes: 1 addition & 1 deletion src/js/common/common.js
Expand Up @@ -150,7 +150,7 @@ module.exports = {
},

/**
* Set 'title' attribute for all elements that has exceeded content in
* Set 'title' attribute for all elements that have exceeded content in
* container
* @param {string} selector - CSS selector {@see domutil#find}
* @param {HTMLElement} container - container element
Expand Down
3 changes: 1 addition & 2 deletions src/js/common/reqAnimFrame.js
Expand Up @@ -4,7 +4,6 @@
*/
'use strict';

var util = require('tui-code-snippet');
var requestFn,
cancelFn;

Expand Down Expand Up @@ -40,7 +39,7 @@ module.exports = {
* @returns {number} Unique id
*/
requestAnimFrame: function(fn, context) {
return requestFn.call(global, util.bind(fn, context));
return requestFn.call(global, fn.bind(context));
},

/**
Expand Down
2 changes: 1 addition & 1 deletion src/js/factory/controller.js
Expand Up @@ -20,7 +20,7 @@ function mixin(from, to, propertyName) {
var obj = to[propertyName] = {};

util.forEach(from, function(method, methodName) {
obj[methodName] = util.bind(method, to);
obj[methodName] = method.bind(to);
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/js/handler/time/core.js
Expand Up @@ -49,7 +49,7 @@ var timeCore = {
/**
* @param {MouseEvent} mouseEvent - mouse event object to get common event data.
* @param {object} [extend] - object to extend event data before return.
* @returns {object} - common event data for time.*
* @returns {object} - common event data for time
*/
return function(mouseEvent, extend) {
var mouseY = Point.n(domevent.getMousePosition(mouseEvent, container)).y,
Expand Down Expand Up @@ -80,7 +80,7 @@ var timeCore = {
* @param {TZDate} startDate - start date
* @param {TZDate} endDate - end date
* @param {number} hourStart Can limit of render hour start.
* @returns {object} - common event data for time.* from mouse event.
* @returns {object} - common event data for time from mouse event.
*/
_retriveScheduleDataFromDate: function(timeView, startDate, endDate, hourStart) {
var viewTime = timeView.getDate();
Expand Down
4 changes: 2 additions & 2 deletions src/js/view/week/timeGrid.js
Expand Up @@ -545,7 +545,7 @@ TimeGrid.prototype.attachEvent = function() {
clearTimeout(this.timerID);
this.intervalID = this.timerID = this.rAnimationFrameID = null;

this.timerID = setTimeout(util.bind(this.onTick, this), (SIXTY_SECONDS - new TZDate().getSeconds()) * 1000);
this.timerID = setTimeout(this.onTick.bind(this), (SIXTY_SECONDS - new TZDate().getSeconds()) * 1000);

domevent.on(this.stickyContainer, 'click', this._onClickStickyContainer, this);
};
Expand Down Expand Up @@ -600,7 +600,7 @@ TimeGrid.prototype.onTick = function() {
}

if (!this.intervalID) {
this.intervalID = setInterval(util.bind(this.onTick, this), HOURMARKER_REFRESH_INTERVAL);
this.intervalID = setInterval(this.onTick.bind(this), HOURMARKER_REFRESH_INTERVAL);
}
this.refreshHourmarker();
};
Expand Down