Upgrade some deps

This commit is contained in:
Gregory Schier 2016-06-19 23:14:51 -07:00
parent c5339b98a6
commit 4e4d085403
3 changed files with 14 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import RequestPane from '../components/RequestPane'
import ResponsePane from '../components/ResponsePane'
import Sidebar from '../components/Sidebar'
import {PREVIEW_MODE_FRIENDLY} from '../lib/previewModes'
import {MAX_PANE_WIDTH, MIN_PANE_WIDTH, MAX_SIDEBAR_REMS, MIN_SIDEBAR_REMS} from '../lib/constants'
import * as GlobalActions from '../redux/modules/global'
import * as RequestGroupActions from '../redux/modules/requestGroups'
@ -82,13 +83,14 @@ class App extends Component {
const pixelOffset = e.clientX - requestPane.offsetLeft;
let paneWidth = pixelOffset / (requestPaneWidth + responsePaneWidth);
paneWidth = Math.min(Math.max(paneWidth, 0.01), 0.99);
paneWidth = Math.min(Math.max(paneWidth, MIN_PANE_WIDTH), MAX_PANE_WIDTH);
this.setState({paneWidth});
} else if (this.state.draggingSidebar) {
const currentPixelWidth = ReactDOM.findDOMNode(this.refs.sidebar).offsetWidth;
const ratio = e.clientX / currentPixelWidth;
const sidebarWidth = Math.max(Math.min(this.state.sidebarWidth * ratio, 25), 13);
const width = this.state.sidebarWidth * ratio;
const sidebarWidth = Math.max(Math.min(width, MAX_SIDEBAR_REMS), MIN_SIDEBAR_REMS);
this.setState({sidebarWidth})
}
})

View File

@ -2,6 +2,12 @@
export const LOCALSTORAGE_KEY = 'insomnia.state';
export const DB_PERSIST_INTERVAL = 1000;
// UI Stuff
export const MAX_SIDEBAR_REMS = 35;
export const MIN_SIDEBAR_REMS = 13;
export const MAX_PANE_WIDTH = 0.99;
export const MIN_PANE_WIDTH = 0.01;
// HTTP Methods
export const METHOD_GET = 'GET';
export const METHOD_PUT = 'PUT';

View File

@ -14,10 +14,10 @@
"json-lint": "^0.1.0",
"jsonschema": "^1.1.0",
"nunjucks": "^1.3.4",
"react": "^0.14.7",
"react-dom": "^0.14.7",
"react": "^15.1.0",
"react-dom": "^15.1.0",
"react-redux": "^4.4.1",
"react-tabs": "^0.5.3",
"react-tabs": "^0.5.4",
"redux": "^3.3.1",
"redux-logger": "^2.6.1",
"redux-shortcuts": "0.0.1",
@ -43,7 +43,7 @@
"jest-cli": "^0.9.2",
"json-loader": "^0.5.4",
"node-sass": "^3.4.2",
"react-addons-test-utils": "^0.14.7",
"react-addons-test-utils": "^15.1.0",
"react-hot-loader": "^1.3.0",
"redux-mock-store": "^1.0.2",
"sass-loader": "^3.2.0",