Skip to content

Commit

Permalink
v2.4.7 (#3034)
Browse files Browse the repository at this point in the history
* CollectionView#reorder will remove an already displayed emptyView

* Bump and build 2.4.7
  • Loading branch information
ahumphreys87 committed May 31, 2016
1 parent e9de4a1 commit e1a512a
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = function(grunt) {
options : {
banner: '<%= meta.core_bundle %>',
sourceMap : true,
sourceMapName : 'lib/core/backbone.marionette.map',
sourceMapName : 'lib/core/backbone.marionette.min.js.map',
sourceMappingURL : '<%= uglify.bundle.options.sourceMappingURL %>',
sourceMapPrefix : 1
}
Expand All @@ -98,7 +98,7 @@ module.exports = function(grunt) {
options : {
banner: '<%= meta.banner %>',
sourceMap : true,
sourceMapName : 'lib/backbone.marionette.map',
sourceMapName : 'lib/backbone.marionette.min.js.map',
sourceMappingURL : 'backbone.marionette.map',
sourceMapPrefix : 2
}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Make your Backbone.js apps dance with a composite application architecture!",
"homepage": "http://marionettejs.org",
"main": "./lib/core/backbone.marionette.js",
"version": "2.4.6",
"version": "2.4.7",
"keywords": [
"backbone",
"framework",
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### v2.4.7 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.4.6...v2.4.7)

#### Fixes

* CollectionView#reorder will no longer remove an already displayed emptyView.
* Fixed build of sourcemap files.

### v2.4.6 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.4.5...v2.4.6)

#### Misc
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": "2.4.6",
"version": "2.4.7",
"repo": "marionettejs/backbone.marionette",
"main": "lib/core/backbone.marionette.js",
"keywords": [
Expand Down
7 changes: 5 additions & 2 deletions lib/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v2.4.6
// v2.4.7
//
// Copyright (c)2016 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -489,7 +489,7 @@

var Marionette = Backbone.Marionette = {};

Marionette.VERSION = '2.4.6';
Marionette.VERSION = '2.4.7';

Marionette.noConflict = function() {
root.Marionette = previousMarionette;
Expand Down Expand Up @@ -2310,6 +2310,9 @@
reorder: function() {
var children = this.children;
var models = this._filteredSortedModels();

if (!models.length && this._showingEmptyView) { return this; }

var anyModelsAdded = _.some(models, function(model) {
return !children.findByModel(model);
});
Expand Down
6 changes: 3 additions & 3 deletions lib/backbone.marionette.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/backbone.marionette.min.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions lib/core/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// MarionetteJS (Backbone.Marionette)
// ----------------------------------
// v2.4.6
// v2.4.7
//
// Copyright (c)2016 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
Expand Down Expand Up @@ -31,7 +31,7 @@

var Marionette = Backbone.Marionette = {};

Marionette.VERSION = '2.4.6';
Marionette.VERSION = '2.4.7';

Marionette.noConflict = function() {
root.Marionette = previousMarionette;
Expand Down Expand Up @@ -1857,6 +1857,9 @@
reorder: function() {
var children = this.children;
var models = this._filteredSortedModels();

if (!models.length && this._showingEmptyView) { return this; }

var anyModelsAdded = _.some(models, function(model) {
return !children.findByModel(model);
});
Expand Down
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 lib/core/backbone.marionette.min.js.map

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": "2.4.6",
"version": "2.4.7",
"homepage": "https://github.com/marionettejs/backbone.marionette",
"main": "lib/core/backbone.marionette.js",
"keywords": [
Expand Down
3 changes: 3 additions & 0 deletions src/collection-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ Marionette.CollectionView = Marionette.View.extend({
reorder: function() {
var children = this.children;
var models = this._filteredSortedModels();

if (!models.length && this._showingEmptyView) { return this; }

var anyModelsAdded = _.some(models, function(model) {
return !children.findByModel(model);
});
Expand Down
17 changes: 17 additions & 0 deletions test/unit/collection-view.empty-view.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,23 @@ describe('collectionview - emptyView', function() {
});
});

describe('when reorder is called with an emptyView', function() {
beforeEach(function() {
this.collection = new Backbone.Collection([]);
this.collectionView = new this.EmptyCollectionView({
collection: this.collection
});

this.collectionView.render();

this.collectionView.reorder();
});

it('should append the html for the emptyView', function() {
expect(this.collectionView.$el).to.have.$html('<span>empty</span>');
});
});

describe('when rendering and an "emptyViewOptions" is provided', function() {
beforeEach(function() {
this.collection = new Backbone.Collection();
Expand Down

0 comments on commit e1a512a

Please sign in to comment.