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

@ -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({