Use src-relative path for importing enablePresentationMode action. Add query-string package. Use queryString library to parse location.search.

pull/10616/head
Hunter Trujillo 2017-09-01 15:07:37 -06:00
parent 80ea83c163
commit af03beafb1
3 changed files with 19 additions and 2 deletions

View File

@ -109,6 +109,7 @@
"lodash": "^4.3.0",
"moment": "^2.13.0",
"node-uuid": "^1.4.7",
"query-string": "^5.0.0",
"react": "^15.0.2",
"react-addons-shallow-compare": "^15.0.2",
"react-custom-scrollbars": "^4.1.1",

View File

@ -1,5 +1,6 @@
// Trigger resize event to relayout the React Layout plugin
import {enablePresentationMode} from '../actions/app'
import queryString from 'query-string'
import {enablePresentationMode} from 'src/shared/actions/app'
export default function resizeLayout() {
return next => action => {
@ -13,7 +14,10 @@ export default function resizeLayout() {
evt.initEvent('resize', false, true)
window.dispatchEvent(evt)
}
if (window.location.search.includes('present')) {
const qs = queryString.parse(window.location.search)
if (typeof qs.present !== 'undefined') {
next(enablePresentationMode())
next(action)
}

View File

@ -2329,6 +2329,10 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
version "1.2.0"
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
decode-uri-component@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
deep-eql@^0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2"
@ -5862,6 +5866,14 @@ query-string@^4.1.0, query-string@^4.2.2:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
query-string@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.0.0.tgz#fbdf7004b4d2aff792f9871981b7a2794f555947"
dependencies:
decode-uri-component "^0.2.0"
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
querystring-es3@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73"