File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ Marionette.Layout = Marionette.ItemView.extend({
13
13
// Ensure the regions are avialable when the `initialize` method
14
14
// is called.
15
15
constructor : function ( ) {
16
+ this . _firstRender = true ;
16
17
this . initializeRegions ( ) ;
17
18
Backbone . Marionette . ItemView . apply ( this , arguments ) ;
18
19
} ,
@@ -22,13 +23,16 @@ Marionette.Layout = Marionette.ItemView.extend({
22
23
// views that the regions are showing and then reset the `el`
23
24
// for the regions to the newly rendered DOM elements.
24
25
render : function ( ) {
25
- // If this is not the first render call, then we need to
26
- // re-initializing the `el` for each region
27
- if ( ! this . _firstRender ) {
26
+
27
+ if ( this . _firstRender ) {
28
+ // if this is the first render, don't do anything to
29
+ // reset the regions
30
+ this . _firstRender = false ;
31
+ } else {
32
+ // If this is not the first render call, then we need to
33
+ // re-initializing the `el` for each region
28
34
this . closeRegions ( ) ;
29
35
this . reInitializeRegions ( ) ;
30
- } else {
31
- this . _firstRender = false ;
32
36
}
33
37
34
38
var result = Marionette . ItemView . prototype . render . apply ( this , arguments ) ;
You can’t perform that action at this time.
0 commit comments