Skip to content

Commit

Permalink
bump and build v1.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
samccone committed Apr 1, 2014
1 parent a20d296 commit f455201
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 109 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"./lib/backbone.marionette.js",
"./lib/core/amd/backbone.marionette.js"
],
"version": "1.7.3",
"version": "1.7.4",
"keywords": [
"backbone",
"framework",
Expand Down
10 changes: 10 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### v1.7.4 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v1.7.3...v1.7.4)

* General
* Update bower dependencies to take advantage of the fact that marionette repos follow semver.

* Fixes
* Behaviors events no longer collide with each other.
* Revert `stopListening` call on `stop` for modules. While this was a "fix", the docs were quite vague leading to breaking changes for many people.
* `startWithParent` is now respected when using a `moduleClass` property.

### v1.7.3 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v1.7.2...v1.7.3)

* Behaviors
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backbone.marionette",
"description": "Make your Backbone.js apps dance!",
"version": "1.7.3",
"version": "1.7.4",
"repo": "marionettejs/backbone.marionette",
"main": "lib/core/amd/backbone.marionette.js",
"keywords": [
Expand Down
78 changes: 45 additions & 33 deletions lib/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.7.3
// v1.7.4
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -2288,7 +2288,8 @@ Marionette.Behaviors = (function(Marionette, _) {
_.each(_.keys(behaviorEvents), function(key) {
// append white-space at the end of each key to prevent behavior key collisions
// this is relying on the fact backbone events considers "click .foo" the same "click .foo "
var whitespace = (new Array(i+1)).join(" ");
// starts with an array of two so the first behavior has one space
var whitespace = (new Array(i+2)).join(" ");
var eventKey = key + whitespace;
var handler = _.isFunction(behaviorEvents[key]) ? behaviorEvents[key] : b[behaviorEvents[key]];

Expand Down Expand Up @@ -2612,8 +2613,6 @@ _.extend(Marionette.Module.prototype, Backbone.Events, {
this._initializerCallbacks.reset();
this._finalizerCallbacks.reset();

this.stopListening();

Marionette.triggerMethod.call(this, "stop");
},

Expand Down Expand Up @@ -2713,49 +2712,62 @@ _.extend(Marionette.Module, {
return moduleDefinition.moduleClass || ModuleClass;
},

// Add the module definition and add a startWithParent initializer function.
// This is complicated because module definitions are heavily overloaded
// and support an anonymous function, module class, or options object
_addModuleDefinition: function(parentModule, module, def, args){
var fn;
var startWithParent;
var fn = this._getDefine(def);
var startWithParent = this._getStartWithParent(def, module);

if (fn){
module.addDefinition(fn, args);
}

if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)){
// if a function is supplied for the module definition
fn = def;
startWithParent = true;
this._addStartWithParent(parentModule, module, startWithParent);
},

} else if (_.isObject(def)){
// if an object is supplied
fn = def.define;
startWithParent = !_.isUndefined(def.startWithParent) ? def.startWithParent : true;
_getStartWithParent: function(def, module) {
var swp;

} else {
// if nothing is supplied
startWithParent = true;
if (_.isFunction(def) && (def.prototype instanceof Marionette.Module)) {
swp = module.constructor.prototype.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// add module definition if needed
if (fn){
module.addDefinition(fn, args);
if (_.isObject(def)){
swp = def.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// `and` the two together, ensuring a single `false` will prevent it
// from starting with the parent
module.startWithParent = module.startWithParent && startWithParent;
return true;
},

// setup auto-start if needed
if (module.startWithParent && !module.startWithParentIsConfigured){
_getDefine: function(def) {
if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)) {
return def;
}

// only configure this once
module.startWithParentIsConfigured = true;
if (_.isObject(def)){
return def.define;
}

// add the module initializer config
parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
return null;
},

_addStartWithParent: function(parentModule, module, startWithParent) {
module.startWithParent = module.startWithParent && startWithParent;

if (!module.startWithParent || !!module.startWithParentIsConfigured){
return;
}

module.startWithParentIsConfigured = true;

parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
}
});

Expand Down
2 changes: 1 addition & 1 deletion lib/backbone.marionette.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/backbone.marionette.min.js

Large diffs are not rendered by default.

78 changes: 45 additions & 33 deletions lib/core/amd/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v1.7.3
// v1.7.4
//
// Copyright (c)2014 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -1878,7 +1878,8 @@ Marionette.Behaviors = (function(Marionette, _) {
_.each(_.keys(behaviorEvents), function(key) {
// append white-space at the end of each key to prevent behavior key collisions
// this is relying on the fact backbone events considers "click .foo" the same "click .foo "
var whitespace = (new Array(i+1)).join(" ");
// starts with an array of two so the first behavior has one space
var whitespace = (new Array(i+2)).join(" ");
var eventKey = key + whitespace;
var handler = _.isFunction(behaviorEvents[key]) ? behaviorEvents[key] : b[behaviorEvents[key]];

Expand Down Expand Up @@ -2202,8 +2203,6 @@ _.extend(Marionette.Module.prototype, Backbone.Events, {
this._initializerCallbacks.reset();
this._finalizerCallbacks.reset();

this.stopListening();

Marionette.triggerMethod.call(this, "stop");
},

Expand Down Expand Up @@ -2303,49 +2302,62 @@ _.extend(Marionette.Module, {
return moduleDefinition.moduleClass || ModuleClass;
},

// Add the module definition and add a startWithParent initializer function.
// This is complicated because module definitions are heavily overloaded
// and support an anonymous function, module class, or options object
_addModuleDefinition: function(parentModule, module, def, args){
var fn;
var startWithParent;
var fn = this._getDefine(def);
var startWithParent = this._getStartWithParent(def, module);

if (fn){
module.addDefinition(fn, args);
}

if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)){
// if a function is supplied for the module definition
fn = def;
startWithParent = true;
this._addStartWithParent(parentModule, module, startWithParent);
},

} else if (_.isObject(def)){
// if an object is supplied
fn = def.define;
startWithParent = !_.isUndefined(def.startWithParent) ? def.startWithParent : true;
_getStartWithParent: function(def, module) {
var swp;

} else {
// if nothing is supplied
startWithParent = true;
if (_.isFunction(def) && (def.prototype instanceof Marionette.Module)) {
swp = module.constructor.prototype.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// add module definition if needed
if (fn){
module.addDefinition(fn, args);
if (_.isObject(def)){
swp = def.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// `and` the two together, ensuring a single `false` will prevent it
// from starting with the parent
module.startWithParent = module.startWithParent && startWithParent;
return true;
},

// setup auto-start if needed
if (module.startWithParent && !module.startWithParentIsConfigured){
_getDefine: function(def) {
if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)) {
return def;
}

// only configure this once
module.startWithParentIsConfigured = true;
if (_.isObject(def)){
return def.define;
}

// add the module initializer config
parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
return null;
},

_addStartWithParent: function(parentModule, module, startWithParent) {
module.startWithParent = module.startWithParent && startWithParent;

if (!module.startWithParent || !!module.startWithParentIsConfigured){
return;
}

module.startWithParentIsConfigured = true;

parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
}
});

Expand Down
4 changes: 2 additions & 2 deletions lib/core/amd/backbone.marionette.min.js

Large diffs are not rendered by default.

76 changes: 44 additions & 32 deletions lib/core/backbone.marionette.js
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,8 @@ Marionette.Behaviors = (function(Marionette, _) {
_.each(_.keys(behaviorEvents), function(key) {
// append white-space at the end of each key to prevent behavior key collisions
// this is relying on the fact backbone events considers "click .foo" the same "click .foo "
var whitespace = (new Array(i+1)).join(" ");
// starts with an array of two so the first behavior has one space
var whitespace = (new Array(i+2)).join(" ");
var eventKey = key + whitespace;
var handler = _.isFunction(behaviorEvents[key]) ? behaviorEvents[key] : b[behaviorEvents[key]];

Expand Down Expand Up @@ -2166,8 +2167,6 @@ _.extend(Marionette.Module.prototype, Backbone.Events, {
this._initializerCallbacks.reset();
this._finalizerCallbacks.reset();

this.stopListening();

Marionette.triggerMethod.call(this, "stop");
},

Expand Down Expand Up @@ -2267,49 +2266,62 @@ _.extend(Marionette.Module, {
return moduleDefinition.moduleClass || ModuleClass;
},

// Add the module definition and add a startWithParent initializer function.
// This is complicated because module definitions are heavily overloaded
// and support an anonymous function, module class, or options object
_addModuleDefinition: function(parentModule, module, def, args){
var fn;
var startWithParent;
var fn = this._getDefine(def);
var startWithParent = this._getStartWithParent(def, module);

if (fn){
module.addDefinition(fn, args);
}

if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)){
// if a function is supplied for the module definition
fn = def;
startWithParent = true;
this._addStartWithParent(parentModule, module, startWithParent);
},

} else if (_.isObject(def)){
// if an object is supplied
fn = def.define;
startWithParent = !_.isUndefined(def.startWithParent) ? def.startWithParent : true;
_getStartWithParent: function(def, module) {
var swp;

} else {
// if nothing is supplied
startWithParent = true;
if (_.isFunction(def) && (def.prototype instanceof Marionette.Module)) {
swp = module.constructor.prototype.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// add module definition if needed
if (fn){
module.addDefinition(fn, args);
if (_.isObject(def)){
swp = def.startWithParent;
return _.isUndefined(swp) ? true : swp;
}

// `and` the two together, ensuring a single `false` will prevent it
// from starting with the parent
module.startWithParent = module.startWithParent && startWithParent;
return true;
},

// setup auto-start if needed
if (module.startWithParent && !module.startWithParentIsConfigured){
_getDefine: function(def) {
if (_.isFunction(def) && !(def.prototype instanceof Marionette.Module)) {
return def;
}

// only configure this once
module.startWithParentIsConfigured = true;
if (_.isObject(def)){
return def.define;
}

// add the module initializer config
parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
return null;
},

_addStartWithParent: function(parentModule, module, startWithParent) {
module.startWithParent = module.startWithParent && startWithParent;

if (!module.startWithParent || !!module.startWithParentIsConfigured){
return;
}

module.startWithParentIsConfigured = true;

parentModule.addInitializer(function(options){
if (module.startWithParent){
module.start(options);
}
});
}
});

Expand Down
2 changes: 1 addition & 1 deletion lib/core/backbone.marionette.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/core/backbone.marionette.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "backbone.marionette",
"description": "Make your Backbone.js apps dance!",
"version": "1.7.3",
"version": "1.7.4",

This comment has been minimized.

Copy link
@jamesplease

jamesplease Apr 1, 2014

Member

😓 phew

"homepage": "https://github.com/marionettejs/backbone.marionette",
"main": "lib/core/amd/backbone.marionette.js",
"keywords": [
Expand Down
Loading

0 comments on commit f455201

Please sign in to comment.