Skip to content

Commit e1a512a

Browse files
committed
v2.4.7 (#3034)
* CollectionView#reorder will remove an already displayed emptyView * Bump and build 2.4.7
1 parent e9de4a1 commit e1a512a

13 files changed

+49
-16
lines changed

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ module.exports = function(grunt) {
8686
options : {
8787
banner: '<%= meta.core_bundle %>',
8888
sourceMap : true,
89-
sourceMapName : 'lib/core/backbone.marionette.map',
89+
sourceMapName : 'lib/core/backbone.marionette.min.js.map',
9090
sourceMappingURL : '<%= uglify.bundle.options.sourceMappingURL %>',
9191
sourceMapPrefix : 1
9292
}
@@ -98,7 +98,7 @@ module.exports = function(grunt) {
9898
options : {
9999
banner: '<%= meta.banner %>',
100100
sourceMap : true,
101-
sourceMapName : 'lib/backbone.marionette.map',
101+
sourceMapName : 'lib/backbone.marionette.min.js.map',
102102
sourceMappingURL : 'backbone.marionette.map',
103103
sourceMapPrefix : 2
104104
}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Make your Backbone.js apps dance with a composite application architecture!",
44
"homepage": "http://marionettejs.org",
55
"main": "./lib/core/backbone.marionette.js",
6-
"version": "2.4.6",
6+
"version": "2.4.7",
77
"keywords": [
88
"backbone",
99
"framework",

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
### v2.4.7 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.4.6...v2.4.7)
2+
3+
#### Fixes
4+
5+
* CollectionView#reorder will no longer remove an already displayed emptyView.
6+
* Fixed build of sourcemap files.
7+
18
### v2.4.6 [view commit logs](https://github.com/marionettejs/backbone.marionette/compare/v2.4.5...v2.4.6)
29

310
#### Misc

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "backbone.marionette",
33
"description": "Make your Backbone.js apps dance!",
4-
"version": "2.4.6",
4+
"version": "2.4.7",
55
"repo": "marionettejs/backbone.marionette",
66
"main": "lib/core/backbone.marionette.js",
77
"keywords": [

lib/backbone.marionette.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MarionetteJS (Backbone.Marionette)
22
// ----------------------------------
3-
// v2.4.6
3+
// v2.4.7
44
//
55
// Copyright (c)2016 Derick Bailey, Muted Solutions, LLC.
66
// Distributed under MIT license
@@ -489,7 +489,7 @@
489489

490490
var Marionette = Backbone.Marionette = {};
491491

492-
Marionette.VERSION = '2.4.6';
492+
Marionette.VERSION = '2.4.7';
493493

494494
Marionette.noConflict = function() {
495495
root.Marionette = previousMarionette;
@@ -2310,6 +2310,9 @@
23102310
reorder: function() {
23112311
var children = this.children;
23122312
var models = this._filteredSortedModels();
2313+
2314+
if (!models.length && this._showingEmptyView) { return this; }
2315+
23132316
var anyModelsAdded = _.some(models, function(model) {
23142317
return !children.findByModel(model);
23152318
});

lib/backbone.marionette.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/backbone.marionette.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/backbone.marionette.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// MarionetteJS (Backbone.Marionette)
22
// ----------------------------------
3-
// v2.4.6
3+
// v2.4.7
44
//
55
// Copyright (c)2016 Derick Bailey, Muted Solutions, LLC.
66
// Distributed under MIT license
@@ -31,7 +31,7 @@
3131

3232
var Marionette = Backbone.Marionette = {};
3333

34-
Marionette.VERSION = '2.4.6';
34+
Marionette.VERSION = '2.4.7';
3535

3636
Marionette.noConflict = function() {
3737
root.Marionette = previousMarionette;
@@ -1857,6 +1857,9 @@
18571857
reorder: function() {
18581858
var children = this.children;
18591859
var models = this._filteredSortedModels();
1860+
1861+
if (!models.length && this._showingEmptyView) { return this; }
1862+
18601863
var anyModelsAdded = _.some(models, function(model) {
18611864
return !children.findByModel(model);
18621865
});

lib/core/backbone.marionette.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core/backbone.marionette.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "backbone.marionette",
33
"description": "Make your Backbone.js apps dance!",
4-
"version": "2.4.6",
4+
"version": "2.4.7",
55
"homepage": "https://github.com/marionettejs/backbone.marionette",
66
"main": "lib/core/backbone.marionette.js",
77
"keywords": [

src/collection-view.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ Marionette.CollectionView = Marionette.View.extend({
165165
reorder: function() {
166166
var children = this.children;
167167
var models = this._filteredSortedModels();
168+
169+
if (!models.length && this._showingEmptyView) { return this; }
170+
168171
var anyModelsAdded = _.some(models, function(model) {
169172
return !children.findByModel(model);
170173
});

test/unit/collection-view.empty-view.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,23 @@ describe('collectionview - emptyView', function() {
332332
});
333333
});
334334

335+
describe('when reorder is called with an emptyView', function() {
336+
beforeEach(function() {
337+
this.collection = new Backbone.Collection([]);
338+
this.collectionView = new this.EmptyCollectionView({
339+
collection: this.collection
340+
});
341+
342+
this.collectionView.render();
343+
344+
this.collectionView.reorder();
345+
});
346+
347+
it('should append the html for the emptyView', function() {
348+
expect(this.collectionView.$el).to.have.$html('<span>empty</span>');
349+
});
350+
});
351+
335352
describe('when rendering and an "emptyViewOptions" is provided', function() {
336353
beforeEach(function() {
337354
this.collection = new Backbone.Collection();

0 commit comments

Comments
 (0)