marionette-rails 0.9.7 → 0.9.8
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.
|
1
|
+
// Backbone.Marionette v0.9.8
|
2
2
|
//
|
3
3
|
// Copyright (C)2012 Derick Bailey, Muted Solutions, LLC
|
4
4
|
// Distributed Under MIT License
|
@@ -969,9 +969,7 @@ Marionette.Module = function(moduleName, app, customArgs){
|
|
969
969
|
// store sub-modules
|
970
970
|
this.submodules = {};
|
971
971
|
|
972
|
-
|
973
|
-
this._initializerCallbacks = new Marionette.Callbacks();
|
974
|
-
this._finalizerCallbacks = new Marionette.Callbacks();
|
972
|
+
this._setupInitializersAndFinalizers();
|
975
973
|
|
976
974
|
// store the configuration for this module
|
977
975
|
this._config = {};
|
@@ -1025,7 +1023,11 @@ _.extend(Marionette.Module.prototype, Backbone.Events, {
|
|
1025
1023
|
if (!this._isInitialized){ return; }
|
1026
1024
|
this._isInitialized = false;
|
1027
1025
|
|
1026
|
+
// run the finalizers
|
1028
1027
|
this._finalizerCallbacks.run();
|
1028
|
+
// then reset the initializers and finalizers
|
1029
|
+
this._setupInitializersAndFinalizers();
|
1030
|
+
|
1029
1031
|
// stop the sub-modules
|
1030
1032
|
_.each(this.submodules, function(mod){ mod.stop(); });
|
1031
1033
|
},
|
@@ -1059,6 +1061,14 @@ _.extend(Marionette.Module.prototype, Backbone.Events, {
|
|
1059
1061
|
definition.apply(this, args);
|
1060
1062
|
|
1061
1063
|
}
|
1064
|
+
},
|
1065
|
+
|
1066
|
+
// Internal method: set up new copies of initializers and finalizers.
|
1067
|
+
// Calling this method will wipe out all existing initializers and
|
1068
|
+
// finalizers.
|
1069
|
+
_setupInitializersAndFinalizers: function(){
|
1070
|
+
this._initializerCallbacks = new Marionette.Callbacks();
|
1071
|
+
this._finalizerCallbacks = new Marionette.Callbacks();
|
1062
1072
|
}
|
1063
1073
|
});
|
1064
1074
|
|