Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
ea44a196
Commit
ea44a196
authored
6 years ago
by
KDSBrowne
Browse files
Options
Downloads
Patches
Plain Diff
make resizable panel width persist
parent
9428358f
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton-html5/imports/ui/components/panel-manager/component.jsx
+30
-13
30 additions, 13 deletions
...n-html5/imports/ui/components/panel-manager/component.jsx
with
30 additions
and
13 deletions
bigbluebutton-html5/imports/ui/components/panel-manager/component.jsx
+
30
−
13
View file @
ea44a196
...
...
@@ -28,6 +28,14 @@ const propTypes = {
openPanel
:
PropTypes
.
string
.
isRequired
,
};
// Variables for resizing user-list.
const
USERLIST_MIN_WIDTH_PX
=
150
;
const
USERLIST_MAX_WIDTH_PX
=
240
;
// Variables for resizing chat.
const
CHAT_MIN_WIDTH
=
150
;
const
CHAT_MAX_WIDTH
=
350
;
class
PanelManager
extends
Component
{
constructor
()
{
super
();
...
...
@@ -37,6 +45,14 @@ class PanelManager extends Component {
this
.
breakoutroomKey
=
_
.
uniqueId
(
'
breakoutroom-
'
);
this
.
chatKey
=
_
.
uniqueId
(
'
chat-
'
);
this
.
pollKey
=
_
.
uniqueId
(
'
poll-
'
);
this
.
state
=
{
chatWidth
:
320
,
// decide whether using pixel or percentage unit as a default width for userList:
// userlist default relative width = 18;
userlistWidth
:
(
window
.
innerWidth
*
(
18
/
100.0
))
<
USERLIST_MAX_WIDTH_PX
?
18
:
USERLIST_MAX_WIDTH_PX
,
};
}
renderUserList
()
{
...
...
@@ -57,13 +73,7 @@ class PanelManager extends Component {
}
renderUserListResizable
()
{
// Variables for resizing user-list.
const
USERLIST_MIN_WIDTH_PX
=
150
;
const
USERLIST_MAX_WIDTH_PX
=
240
;
const
USERLIST_DEFAULT_WIDTH_RELATIVE
=
18
;
// decide whether using pixel or percentage unit as a default width for userList
const
USERLIST_DEFAULT_WIDTH
=
(
window
.
innerWidth
*
(
USERLIST_DEFAULT_WIDTH_RELATIVE
/
100.0
))
<
USERLIST_MAX_WIDTH_PX
?
`
${
USERLIST_DEFAULT_WIDTH_RELATIVE
}
%`
:
USERLIST_MAX_WIDTH_PX
;
const
{
userlistWidth
}
=
this
.
state
;
const
resizableEnableOptions
=
{
top
:
false
,
...
...
@@ -78,13 +88,18 @@ class PanelManager extends Component {
return
(
<
Resizable
defaultSize
=
{
{
width
:
USERLIST_DEFAULT_WIDTH
}
}
minWidth
=
{
USERLIST_MIN_WIDTH_PX
}
maxWidth
=
{
USERLIST_MAX_WIDTH_PX
}
ref
=
{
(
node
)
=>
{
this
.
resizableUserList
=
node
;
}
}
className
=
{
styles
.
resizableUserList
}
enable
=
{
resizableEnableOptions
}
key
=
{
this
.
userlistKey
}
size
=
{
{
width
:
userlistWidth
}
}
onResizeStop
=
{
(
e
,
direction
,
ref
,
d
)
=>
{
this
.
setState
({
userlistWidth
:
userlistWidth
+
d
.
width
,
});
}
}
>
{
this
.
renderUserList
()
}
</
Resizable
>
...
...
@@ -106,10 +121,7 @@ class PanelManager extends Component {
}
renderChatResizable
()
{
// Variables for resizing chat.
const
CHAT_MIN_WIDTH
=
'
10%
'
;
const
CHAT_MAX_WIDTH
=
'
25%
'
;
const
CHAT_DEFAULT_WIDTH
=
'
15%
'
;
const
{
chatWidth
}
=
this
.
state
;
const
resizableEnableOptions
=
{
top
:
false
,
...
...
@@ -124,13 +136,18 @@ class PanelManager extends Component {
return
(
<
Resizable
defaultSize
=
{
{
width
:
CHAT_DEFAULT_WIDTH
}
}
minWidth
=
{
CHAT_MIN_WIDTH
}
maxWidth
=
{
CHAT_MAX_WIDTH
}
ref
=
{
(
node
)
=>
{
this
.
resizableChat
=
node
;
}
}
className
=
{
styles
.
resizableChat
}
enable
=
{
resizableEnableOptions
}
key
=
{
this
.
chatKey
}
size
=
{
{
width
:
chatWidth
}
}
onResizeStop
=
{
(
e
,
direction
,
ref
,
d
)
=>
{
this
.
setState
({
chatWidth
:
chatWidth
+
d
.
width
,
});
}
}
>
{
this
.
renderChat
()
}
</
Resizable
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment