From 893443b0b26fb313d7900005601e839050465d2f Mon Sep 17 00:00:00 2001 From: Hartorn Date: Fri, 16 Jun 2017 12:11:31 +0200 Subject: [PATCH 1/3] Application Store : mode should be only 0 or 1 (not 2, -1, ...) --- src/store/application/store.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/store/application/store.js b/src/store/application/store.js index bb4b84a..c2b5405 100644 --- a/src/store/application/store.js +++ b/src/store/application/store.js @@ -12,19 +12,16 @@ class ApplicationStore extends CoreStore { super(conf); } /** - * Update the mode value. - * @param {object} dataNode - The value of the data. - */ + * Update the mode value. + * @param {object} dataNode - The value of the data. + */ updateMode(dataNode) { - let modeData = this.data.has('mode') ? this.data.get('mode') : Immutable.fromJS({}); - let newModeValue = modeData.has(dataNode.newMode) ? (modeData.get(dataNode.newMode) + 1) : 1; - //Add a check to not have a negative mode, but it should not happen. - let previousModeValue = modeData.has(dataNode.previousMode) ? (modeData.get(dataNode.previousMode) - 1) : 0; - this.data = this.data.set('mode', - modeData.set(dataNode.newMode, newModeValue).set(dataNode.previousMode, previousModeValue) - ); + const modeData = (this.data.has('mode') ? this.data.get('mode') : Immutable.fromJS({})) + .set(dataNode.newMode, 1) + .set(dataNode.previousMode, 0); + this.data = this.data.set('mode', modeData); this.willEmit('mode:change'); } } -export default ApplicationStore; +export default ApplicationStore; \ No newline at end of file From 1911976641dae0b47741258bc13872f91a47c7fc Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Mon, 11 Sep 2017 17:09:23 +0200 Subject: [PATCH 2/3] Fixing export for history --- src/history/index.js | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/history/index.js b/src/history/index.js index f9a918e..fe3fde9 100644 --- a/src/history/index.js +++ b/src/history/index.js @@ -1,29 +1,43 @@ let _navigate, _back, _start; // Define the navigation functions depending on backbone or react-router -export const setNavigationFunctions = (navigate, back, start) => { +const setNavigationFunctions = (navigate, back, start) => { _navigate = navigate; _back = back; _start = start; } -export const navigate = (...args) => { - if(!_navigate) { +const navigate = (...args) => { + if (!_navigate) { throw new Error('react-router or backbone URL Navigation was badly given in the setNavigationFunctions()') } _navigate(...args); } -export const back = (...args) => { - if(!_back){ +const back = (...args) => { + if (!_back) { throw new Error('react-router or backbone Previous Page Navigation was badly given in the setNavigationFunctions()') } _back(...args); } -export const start = (...args) => { - if(!_start) { +const start = (...args) => { + if (!_start) { throw new Error('Backbone start router was badly given in the setNavigationFunctions()') } _start(...args); } + +export { + setNavigationFunctions, + navigate, + back, + start +} + +export default { + setNavigationFunctions, + navigate, + back, + start +} \ No newline at end of file From ae1a227088f23925ad2117c8236ec11e72c0790d Mon Sep 17 00:00:00 2001 From: Bazire Houssin Date: Mon, 11 Sep 2017 17:12:22 +0200 Subject: [PATCH 3/3] Updating versions for release 2.2.0-beta3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c965375..b85eb2a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "focus-core", - "version": "2.2.0-beta2", + "version": "2.2.0-beta3", "description": "Focus library core part.", "main": "index.js", "babel": {