Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
17feda3a
Commit
17feda3a
authored
Oct 27, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dispatch window resize event when menu collapse
parent
cae82425
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
27 deletions
+4
-27
src/components/FooterToolbar/index.js
src/components/FooterToolbar/index.js
+1
-27
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+3
-0
No files found.
src/components/FooterToolbar/index.js
View file @
17feda3a
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classNames
from
'
classnames
'
;
import
classNames
from
'
classnames
'
;
import
styles
from
'
./index.less
'
;
import
styles
from
'
./index.less
'
;
export
default
class
FooterToolbar
extends
Component
{
export
default
class
FooterToolbar
extends
Component
{
static
contextTypes
=
{
layoutCollapsed
:
PropTypes
.
bool
,
};
state
=
{
width
:
''
,
};
componentDidMount
()
{
this
.
syncWidth
();
}
componentWillReceiveProps
()
{
this
.
syncWidth
();
}
syncWidth
()
{
const
sider
=
document
.
querySelectorAll
(
'
.ant-layout-sider
'
)[
0
];
if
(
sider
)
{
this
.
setState
({
width
:
`calc(100% -
${
sider
.
style
.
width
}
)`
,
});
}
}
render
()
{
render
()
{
const
{
children
,
style
,
className
,
extra
,
...
restProps
}
=
this
.
props
;
const
{
children
,
className
,
extra
,
...
restProps
}
=
this
.
props
;
return
(
return
(
<
div
<
div
className
=
{
classNames
(
className
,
styles
.
toolbar
)}
className
=
{
classNames
(
className
,
styles
.
toolbar
)}
ref
=
{
this
.
getRefNode
}
style
=
{{
width
:
this
.
state
.
width
,
...
style
,
}}
{...
restProps
}
{...
restProps
}
>
>
<
div
className
=
{
styles
.
left
}
>
{
extra
}
<
/div
>
<
div
className
=
{
styles
.
left
}
>
{
extra
}
<
/div
>
...
...
src/layouts/BasicLayout.js
View file @
17feda3a
...
@@ -170,6 +170,9 @@ class BasicLayout extends React.PureComponent {
...
@@ -170,6 +170,9 @@ class BasicLayout extends React.PureComponent {
type
:
'
global/changeLayoutCollapsed
'
,
type
:
'
global/changeLayoutCollapsed
'
,
payload
:
!
collapsed
,
payload
:
!
collapsed
,
});
});
const
event
=
document
.
createEvent
(
'
HTMLEvents
'
);
event
.
initEvent
(
'
resize
'
,
true
,
false
);
window
.
dispatchEvent
(
event
);
}
}
handleNoticeClear
=
(
type
)
=>
{
handleNoticeClear
=
(
type
)
=>
{
message
.
success
(
`ζΈ η©ΊδΊ
${
type
}
`
);
message
.
success
(
`ζΈ η©ΊδΊ
${
type
}
`
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment