Skip to content

Commit

Permalink
Update backbone.marionette to v1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wingrunr21 committed Apr 18, 2014
1 parent 7839403 commit d9b2f20
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/marionette-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Marionette
module Rails
VERSION = '1.8.1'
VERSION = '1.8.2'
end
end
24 changes: 20 additions & 4 deletions vendor/assets/javascripts/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.8.1
// v1.8.2
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -2356,6 +2356,11 @@ Marionette.Behavior = (function(_, Backbone){
_.extend(Behavior.prototype, Backbone.Events, {
initialize: function(){},

// stopListening to behavior `onListen` events.
close: function() {
this.stopListening();
},

// Setup class level proxy for triggerMethod.
triggerMethod: Marionette.triggerMethod
});
Expand Down Expand Up @@ -2393,7 +2398,7 @@ Marionette.Behaviors = (function(Marionette, _) {
'delegateEvents', 'undelegateEvents',
'onShow', 'onClose',
'behaviorEvents', 'triggerMethod',
'setElement'
'setElement', 'close'
]);
}

Expand All @@ -2409,6 +2414,17 @@ Marionette.Behaviors = (function(Marionette, _) {
}, this);
},

close: function(close, behaviors) {
var args = _.tail(arguments, 2);
close.apply(this, args);

// Call close on each behavior after
// closing down the view.
// This unbinds event listeners
// that behaviors have registerd for.
_.invoke(behaviors, 'close', args);
},

onShow: function(onShow, behaviors) {
var args = _.tail(arguments, 2);

Expand Down Expand Up @@ -2467,8 +2483,8 @@ Marionette.Behaviors = (function(Marionette, _) {
undelegateEvents.apply(this, args);

_.each(behaviors, function(b) {
Marionette.unbindEntityEvents(this, this.model, Marionette.getOption(b, "modelEvents"));
Marionette.unbindEntityEvents(this, this.collection, Marionette.getOption(b, "collectionEvents"));
Marionette.unbindEntityEvents(b, this.model, Marionette.getOption(b, "modelEvents"));
Marionette.unbindEntityEvents(b, this.collection, Marionette.getOption(b, "collectionEvents"));
}, this);
},

Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/backbone.marionette.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vendor/assets/javascripts/backbone.marionette.min.js

Large diffs are not rendered by default.

0 comments on commit d9b2f20

Please sign in to comment.