diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-26 01:23:44 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-02-26 01:23:44 +0100 |
commit | 2c5068727997d4b223e74e765df75d9773b954f7 (patch) | |
tree | 7d60793db17c146438e3eeff5ff8026e673d5891 /app/assets/javascripts/components/reducers/modal.jsx | |
parent | 3e9d794ea50986db5647b4e05a408bf0208bbfa1 (diff) |
Improve compose form performance, upgrade JS dependencies. LightingBox
now allows to cycle through multiple images
Diffstat (limited to 'app/assets/javascripts/components/reducers/modal.jsx')
-rw-r--r-- | app/assets/javascripts/components/reducers/modal.jsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/components/reducers/modal.jsx b/app/assets/javascripts/components/reducers/modal.jsx index 07da65771..37ffbc62b 100644 --- a/app/assets/javascripts/components/reducers/modal.jsx +++ b/app/assets/javascripts/components/reducers/modal.jsx @@ -23,9 +23,9 @@ export default function modal(state = initialState, action) { case MODAL_CLOSE: return state.set('open', false); case MODAL_INDEX_DECREASE: - return state.update('index', index => Math.max(index - 1, 0)); + return state.update('index', index => (index - 1) % state.get('media').size); case MODAL_INDEX_INCREASE: - return state.update('index', index => Math.min(index + 1, state.get('media').size - 1)); + return state.update('index', index => (index + 1) % state.get('media').size); default: return state; } |