From 359203fc6177c05014135d45941f3b345082b6fe Mon Sep 17 00:00:00 2001 From: Matej Kieres Date: Mon, 23 Mar 2015 21:03:16 +0100 Subject: [PATCH 1/3] Correcting for PR comments --- src/chaplin/views/view.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chaplin/views/view.coffee b/src/chaplin/views/view.coffee index 959e25c7..4b318652 100644 --- a/src/chaplin/views/view.coffee +++ b/src/chaplin/views/view.coffee @@ -194,7 +194,7 @@ module.exports = class View extends Backbone.View # e.g. # @delegate('click', 'button.confirm', @confirm) delegate: (eventName, second, third) -> - if Backbone.utils + if Backbone.utilsBackbone.utils?.delegate return Backbone.utils.delegate(this, eventName, second, third) if typeof eventName isnt 'string' throw new TypeError 'View#delegate: first argument must be a string' @@ -251,7 +251,7 @@ module.exports = class View extends Backbone.View # Remove all handlers registered with @delegate. undelegate: (eventName, second, third) -> - if Backbone.utils + if Backbone.utilsBackbone.utils?.undelegate return Backbone.utils.undelegate(this, eventName, second, third) if eventName if typeof eventName isnt 'string' From 6f433b199e92650d8865f593803279c077970a36 Mon Sep 17 00:00:00 2001 From: Matej Kieres Date: Tue, 24 Mar 2015 16:08:02 +0100 Subject: [PATCH 2/3] Restore the previous statements --- src/chaplin/views/view.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chaplin/views/view.coffee b/src/chaplin/views/view.coffee index 4b318652..b63d224a 100644 --- a/src/chaplin/views/view.coffee +++ b/src/chaplin/views/view.coffee @@ -194,7 +194,7 @@ module.exports = class View extends Backbone.View # e.g. # @delegate('click', 'button.confirm', @confirm) delegate: (eventName, second, third) -> - if Backbone.utilsBackbone.utils?.delegate + if Backbone.utilsBackbone.utils and Backbone.utilsBackbone.utils?.delegate return Backbone.utils.delegate(this, eventName, second, third) if typeof eventName isnt 'string' throw new TypeError 'View#delegate: first argument must be a string' @@ -251,7 +251,7 @@ module.exports = class View extends Backbone.View # Remove all handlers registered with @delegate. undelegate: (eventName, second, third) -> - if Backbone.utilsBackbone.utils?.undelegate + if Backbone.utilsBackbone.utils and Backbone.utilsBackbone.utils?.undelegate return Backbone.utils.undelegate(this, eventName, second, third) if eventName if typeof eventName isnt 'string' From e683a1e70da48afe63bfa2673c9350d1fc4e3ef5 Mon Sep 17 00:00:00 2001 From: Matej Kieres Date: Tue, 24 Mar 2015 16:20:06 +0100 Subject: [PATCH 3/3] Fix bad typo Replace `Backbone.utilsBackbone.utils` with `Backbone.utils` --- src/chaplin/views/view.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chaplin/views/view.coffee b/src/chaplin/views/view.coffee index b63d224a..bd90466d 100644 --- a/src/chaplin/views/view.coffee +++ b/src/chaplin/views/view.coffee @@ -194,7 +194,7 @@ module.exports = class View extends Backbone.View # e.g. # @delegate('click', 'button.confirm', @confirm) delegate: (eventName, second, third) -> - if Backbone.utilsBackbone.utils and Backbone.utilsBackbone.utils?.delegate + if Backbone.utils and Backbone.utils?.delegate return Backbone.utils.delegate(this, eventName, second, third) if typeof eventName isnt 'string' throw new TypeError 'View#delegate: first argument must be a string' @@ -251,7 +251,7 @@ module.exports = class View extends Backbone.View # Remove all handlers registered with @delegate. undelegate: (eventName, second, third) -> - if Backbone.utilsBackbone.utils and Backbone.utilsBackbone.utils?.undelegate + if Backbone.utils and Backbone.utils?.undelegate return Backbone.utils.undelegate(this, eventName, second, third) if eventName if typeof eventName isnt 'string'