marionette-rails 0.10.1 → 0.10.2
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.10.
|
1
|
+
// Backbone.Marionette, v0.10.2
|
2
2
|
// Copyright (c)2012 Derick Bailey, Muted Solutions, LLC.
|
3
3
|
// Distributed under MIT license
|
4
4
|
// http://github.com/derickbailey/backbone.marionette
|
@@ -740,7 +740,9 @@ Marionette.Region.extend = Backbone.View.extend;
|
|
740
740
|
// Used for composite view management and sub-application areas.
|
741
741
|
Marionette.Layout = Marionette.ItemView.extend({
|
742
742
|
regionType: Marionette.Region,
|
743
|
-
|
743
|
+
|
744
|
+
// Ensure the regions are avialable when the `initialize` method
|
745
|
+
// is called.
|
744
746
|
constructor: function () {
|
745
747
|
this.initializeRegions();
|
746
748
|
Backbone.Marionette.ItemView.apply(this, arguments);
|
@@ -751,18 +753,16 @@ Marionette.Layout = Marionette.ItemView.extend({
|
|
751
753
|
// views that the regions are showing and then reset the `el`
|
752
754
|
// for the regions to the newly rendered DOM elements.
|
753
755
|
render: function(){
|
754
|
-
|
755
|
-
|
756
|
-
// Rewrite this function to handle re-rendering and
|
756
|
+
// If this is not the first render call, then we need to
|
757
757
|
// re-initializing the `el` for each region
|
758
|
-
this.
|
758
|
+
if (!this._firstRender){
|
759
759
|
this.closeRegions();
|
760
760
|
this.reInitializeRegions();
|
761
|
+
} else {
|
762
|
+
this._firstRender = false;
|
763
|
+
}
|
761
764
|
|
762
|
-
|
763
|
-
return result;
|
764
|
-
};
|
765
|
-
|
765
|
+
var result = Marionette.ItemView.prototype.render.apply(this, arguments);
|
766
766
|
return result;
|
767
767
|
},
|
768
768
|
|
@@ -1374,8 +1374,10 @@ _.extend(Marionette.Callbacks.prototype, {
|
|
1374
1374
|
// to be run multiple times - whenever the `run` method is called.
|
1375
1375
|
reset: function(){
|
1376
1376
|
var that = this;
|
1377
|
+
var callbacks = this._callbacks;
|
1377
1378
|
this._deferred = $.Deferred();
|
1378
|
-
|
1379
|
+
this._callbacks = [];
|
1380
|
+
_.each(callbacks, function(cb){
|
1379
1381
|
that.add(cb.cb, cb.ctx);
|
1380
1382
|
});
|
1381
1383
|
}
|