Skip to content

Commit

Permalink
split panes: set a minimum size for resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
ekmartin committed Oct 3, 2016
1 parent c0c6a21 commit adb4741
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/reducers/term-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SESSION_ADD, SESSION_SET_ACTIVE } from '../constants/sessions';
import { findBySession } from '../utils/term-groups';
import { decorateTermGroupsReducer } from '../utils/plugins';

const MIN_SIZE = 0.05;
const initialState = Immutable({
termGroups: {},
activeSessions: {},
Expand Down Expand Up @@ -172,6 +173,8 @@ const removeGroup = (state, uid) => {
};

const resizeGroup = (state, uid, sizes) => {
// Make sure none of the sizes fall below MIN_SIZE:
if (sizes.find(size => size < MIN_SIZE)) return state;
return state.setIn(
['termGroups', uid, 'sizes'],
sizes
Expand Down

0 comments on commit adb4741

Please sign in to comment.