marionette-rails 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- // Backbone.Marionette v0.9.8
1
+ // Backbone.Marionette v0.9.9
2
2
  //
3
3
  // Copyright (C)2012 Derick Bailey, Muted Solutions, LLC
4
4
  // Distributed Under MIT License
@@ -35,7 +35,7 @@ _.extend(Marionette.EventBinder.prototype, {
35
35
  eventName: eventName,
36
36
  callback: callback,
37
37
  context: context
38
- }
38
+ };
39
39
 
40
40
  this._eventBindings.push(binding);
41
41
 
@@ -46,7 +46,7 @@ _.extend(Marionette.EventBinder.prototype, {
46
46
  // returned from the `bindTo` method call.
47
47
  unbindFrom: function(binding){
48
48
  binding.obj.off(binding.eventName, binding.callback, binding.context);
49
- this._eventBindings = _.reject(this._eventBindings, function(bind){return bind === binding});
49
+ this._eventBindings = _.reject(this._eventBindings, function(bind){return bind === binding;});
50
50
  },
51
51
 
52
52
  // Unbind all of the events that we have stored.
@@ -152,7 +152,7 @@ Marionette.View = Backbone.View.extend({
152
152
  if (e && e.preventDefault){ e.preventDefault(); }
153
153
  if (e && e.stopPropagation){ e.stopPropagation(); }
154
154
  that.trigger(value);
155
- }
155
+ };
156
156
 
157
157
  });
158
158
 
@@ -163,7 +163,7 @@ Marionette.View = Backbone.View.extend({
163
163
  // to handle the `triggers` configuration
164
164
  delegateEvents: function(events){
165
165
  events = events || this.events;
166
- if (_.isFunction(events)){ events = events.call(this)}
166
+ if (_.isFunction(events)){ events = events.call(this); }
167
167
 
168
168
  var combinedEvents = {};
169
169
  var triggers = this.configureTriggers();
@@ -690,6 +690,15 @@ _.extend(Marionette.Region.prototype, Backbone.Events, {
690
690
  // of the region.
691
691
  attachView: function(view){
692
692
  this.currentView = view;
693
+ },
694
+
695
+ // Reset the region by closing any existing view and
696
+ // clearing out the cached `$el`. The next time a view
697
+ // is shown via this region, the region will re-query the
698
+ // DOM for the region's `el`.
699
+ reset: function(){
700
+ this.close();
701
+ delete this.$el;
693
702
  }
694
703
  });
695
704
 
@@ -728,7 +737,7 @@ Marionette.Layout = Marionette.ItemView.extend({
728
737
 
729
738
  var result = Marionette.ItemView.prototype.render.apply(this, arguments);
730
739
  return result;
731
- }
740
+ };
732
741
 
733
742
  return result;
734
743
  },
@@ -761,7 +770,7 @@ Marionette.Layout = Marionette.ItemView.extend({
761
770
 
762
771
  selector = typeof region === 'string' ? region : region.selector;
763
772
  var regionType = typeof region.regionType === 'undefined'
764
- ? that.regionType : region.regionType
773
+ ? that.regionType : region.regionType;
765
774
 
766
775
  var regionManager = new regionType({
767
776
  el: selector,
@@ -783,7 +792,7 @@ Marionette.Layout = Marionette.ItemView.extend({
783
792
  this.initializeRegions();
784
793
  } else {
785
794
  _.each(this.regionManagers, function(region){
786
- delete region.$el;
795
+ region.reset();
787
796
  });
788
797
  }
789
798
  },
@@ -873,7 +882,7 @@ _.extend(Marionette.Application.prototype, Backbone.Events, {
873
882
  // removeRegion('myRegion')
874
883
  removeRegion: function(region) {
875
884
  this[region].close();
876
- delete this[region]
885
+ delete this[region];
877
886
  },
878
887
 
879
888
  // Create a module, attached to the application
@@ -1079,7 +1088,7 @@ _.extend(Marionette.Module, {
1079
1088
  create: function(app, moduleNames, moduleDefinition){
1080
1089
  var that = this;
1081
1090
  var parentModule = app;
1082
- var moduleNames = moduleNames.split(".");
1091
+ moduleNames = moduleNames.split(".");
1083
1092
 
1084
1093
  // get the custom args passed in after the module definition and
1085
1094
  // get rid of the module name and definition function
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionette-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-08 00:00:00.000000000 Z
12
+ date: 2012-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails