change '_.clone(..args)' to 'Object.assign({}, ..args)'

This commit is contained in:
Hongarc 2018-12-01 06:37:25 +07:00
parent 052aa1e299
commit 489a4b9095
8 changed files with 14 additions and 17 deletions

View file

@ -55,7 +55,7 @@ var GitDemonstrationView = ContainedBase.extend({
this.render();
this.checkScroll();
this.navEvents = _.clone(Backbone.Events);
this.navEvents = Object.assign({}, Backbone.Events);
this.navEvents.on('positive', this.positive, this);
this.navEvents.on('negative', this.negative, this);
this.keyboardListener = new KeyboardListener({
@ -244,4 +244,3 @@ var GitDemonstrationView = ContainedBase.extend({
});
exports.GitDemonstrationView = GitDemonstrationView;

View file

@ -86,7 +86,7 @@ var GeneralButton = ContainedBase.extend({
initialize: function(options) {
options = options || {};
this.navEvents = options.navEvents || _.clone(Backbone.Events);
this.navEvents = options.navEvents || Object.assign({}, Backbone.Events);
this.destination = options.destination;
if (!this.destination) {
this.container = new ModalTerminal();
@ -160,7 +160,7 @@ var LeftRightView = PositiveNegativeBase.extend({
// events system to add support for git demonstration view taking control of the
// click events
this.pipeEvents = options.events;
this.navEvents = _.clone(Backbone.Events);
this.navEvents = Object.assign({}, Backbone.Events);
this.JSON = {
showLeft: (options.showLeft === undefined) ? true : options.showLeft,
@ -305,7 +305,7 @@ var ModalTerminal = ContainedBase.extend({
initialize: function(options) {
options = options || {};
this.navEvents = options.events || _.clone(Backbone.Events);
this.navEvents = options.events || Object.assign({}, Backbone.Events);
this.container = new ModalView();
this.JSON = {
@ -395,7 +395,7 @@ var ConfirmCancelTerminal = Backbone.View.extend({
}.bind(this));
// also setup keyboard
this.navEvents = _.clone(Backbone.Events);
this.navEvents = Object.assign({}, Backbone.Events);
this.navEvents.on('positive', this.positive, this);
this.navEvents.on('negative', this.negative, this);
this.keyboardListener = new KeyboardListener({

View file

@ -40,7 +40,7 @@ var LevelDropdownView = ContainedBase.extend({
}]
};
this.navEvents = _.clone(Backbone.Events);
this.navEvents = Object.assign({}, Backbone.Events);
this.navEvents.on('clickedID', _.debounce(
this.loadLevelID.bind(this),
300,
@ -444,4 +444,3 @@ var SeriesView = BaseView.extend({
});
exports.LevelDropdownView = LevelDropdownView;

View file

@ -48,7 +48,7 @@ var MultiView = Backbone.View.extend({
this.childViews = [];
this.currentIndex = 0;
this.navEvents = _.clone(Backbone.Events);
this.navEvents = Object.assign({}, Backbone.Events);
this.navEvents.on('negative', this.getNegFunc(), this);
this.navEvents.on('positive', this.getPosFunc(), this);
this.navEvents.on('quit', this.finish, this);
@ -192,4 +192,3 @@ var MultiView = Backbone.View.extend({
});
exports.MultiView = MultiView;