Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
fix layout.containerClassName issue, added changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Kunka committed Dec 15, 2016
1 parent ce65446 commit 02dd3f4
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 20 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Change Log
==========

## 3.0.0

Release

## 3.0.1

Fixed issue where `layout.containerClassName` is not reflected in state object after instantiation.
8 changes: 4 additions & 4 deletions demos/mixitup.min.js

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions dist/mixitup.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**!
* MixItUp v3.0.0
* MixItUp v3.0.1
* A high-performance, dependency-free library for animated filtering, sorting and more
* Build 47693865-4fa6-4558-8a21-d91e4c4dd7c8
* Build 5e143f29-5caa-4949-8a63-877d229a1338
*
* @copyright Copyright 2014-2016 KunkaLabs Limited.
* @author KunkaLabs Limited.
Expand Down Expand Up @@ -4992,7 +4992,9 @@

self.callActions('beforeGetInitialState', arguments);

// Map initial values into a mock state object
// Map initial values into a mock state object in order to construct an operation

state.activeContainerClassName = self.config.layout.containerClassName;

if (self.config.load.dataset) {
// Dataset API
Expand All @@ -5002,6 +5004,7 @@
}

operation.startDataset = operation.newDataset = state.activeDataset = self.config.load.dataset.slice();
operation.startContainerClassName = operation.newContainerClassName = state.activeContainerClassName;
operation.show = self.targets.slice();

state = self.callFilters('stateGetInitialState', state, arguments);
Expand All @@ -5010,7 +5013,6 @@

state.activeFilter = self.parseFilterArgs([self.config.load.filter]).command;
state.activeSort = self.parseSortArgs([self.config.load.sort]).command;
state.activeContainerClassName = self.config.layout.containerClassName;
state.totalTargets = self.targets.length;

state = self.callFilters('stateGetInitialState', state, arguments);
Expand All @@ -5032,8 +5034,9 @@
operation.startOrder = operation.newOrder = self.targets;
}

operation.startFilter = operation.newFilter = state.activeFilter;
operation.startSort = operation.newSort = state.activeSort;
operation.startFilter = operation.newFilter = state.activeFilter;
operation.startSort = operation.newSort = state.activeSort;
operation.startContainerClassName = operation.newContainerClassName = state.activeContainerClassName;

if (operation.newFilter.selector === 'all') {
operation.newFilter.selector = self.config.selectors.target;
Expand Down Expand Up @@ -10333,5 +10336,5 @@
mixitup.registerJqPlugin(jq);
}
mixitup.NAME = 'mixitup';
mixitup.CORE_VERSION = '3.0.0';
mixitup.CORE_VERSION = '3.0.1';
})(window);
8 changes: 4 additions & 4 deletions dist/mixitup.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": "mixitup",
"title": "MixItUp",
"version": "3.0.0",
"version": "3.0.1",
"description": "A high-performance, dependency-free library for animated filtering, sorting and more",
"author": "KunkaLabs Limited",
"homepage": "https://www.kunkalabs.com/mixitup/",
Expand Down
11 changes: 7 additions & 4 deletions src/mixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ h.extend(mixitup.Mixer.prototype,

self.callActions('beforeGetInitialState', arguments);

// Map initial values into a mock state object
// Map initial values into a mock state object in order to construct an operation

state.activeContainerClassName = self.config.layout.containerClassName;

if (self.config.load.dataset) {
// Dataset API
Expand All @@ -176,6 +178,7 @@ h.extend(mixitup.Mixer.prototype,
}

operation.startDataset = operation.newDataset = state.activeDataset = self.config.load.dataset.slice();
operation.startContainerClassName = operation.newContainerClassName = state.activeContainerClassName;
operation.show = self.targets.slice();

state = self.callFilters('stateGetInitialState', state, arguments);
Expand All @@ -184,7 +187,6 @@ h.extend(mixitup.Mixer.prototype,

state.activeFilter = self.parseFilterArgs([self.config.load.filter]).command;
state.activeSort = self.parseSortArgs([self.config.load.sort]).command;
state.activeContainerClassName = self.config.layout.containerClassName;
state.totalTargets = self.targets.length;

state = self.callFilters('stateGetInitialState', state, arguments);
Expand All @@ -206,8 +208,9 @@ h.extend(mixitup.Mixer.prototype,
operation.startOrder = operation.newOrder = self.targets;
}

operation.startFilter = operation.newFilter = state.activeFilter;
operation.startSort = operation.newSort = state.activeSort;
operation.startFilter = operation.newFilter = state.activeFilter;
operation.startSort = operation.newSort = state.activeSort;
operation.startContainerClassName = operation.newContainerClassName = state.activeContainerClassName;

if (operation.newFilter.selector === 'all') {
operation.newFilter.selector = self.config.selectors.target;
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,19 @@ describe('mixitup()', () => {

mixer.destroy();
});

it('should add a `layout.containerClassName` class if specified and be reflected in state', () => {
let container = dom.getContainer();
let mixer = mixitup(container, {
layout: {
containerClassName: 'grid'
}
});

let state = mixer.getState();

chai.assert.equal(state.activeContainerClassName, 'grid');

mixer.destroy();
});
});

0 comments on commit 02dd3f4

Please sign in to comment.