Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
e3ae4806
Commit
e3ae4806
authored
1 year ago
by
vkovtun
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-13579: Improved buttons hiding functionality on resize to the left toolbar.
parent
b9d35e84
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!40
SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ui-admin/src/js/components/database/data-browser/LeftToolbar.jsx
+61
-8
61 additions, 8 deletions
...n/src/js/components/database/data-browser/LeftToolbar.jsx
with
61 additions
and
8 deletions
ui-admin/src/js/components/database/data-browser/LeftToolbar.jsx
+
61
−
8
View file @
e3ae4806
...
...
@@ -31,6 +31,8 @@ import logger from "@src/js/common/logger.js";
import
autoBind
from
"
auto-bind
"
;
import
IconButton
from
"
@material-ui/core/IconButton
"
;
import
{
debounce
}
from
"
@material-ui/core
"
;
import
Container
from
"
@src/js/components/common/form/Container.jsx
"
;
import
Popover
from
"
@material-ui/core/Popover
"
;
const
color
=
'
secondary
'
const
iconButtonSize
=
'
medium
'
...
...
@@ -49,7 +51,17 @@ const styles = theme => ({
marginRight
:
0
}
},
toggleButton
:
{}
toggleButton
:
{},
collapsedButtonsContainer
:
{
display
:
'
flex
'
,
flexDirection
:
'
column
'
,
'
&>button
'
:
{
marginBottom
:
theme
.
spacing
(
1
)
},
'
&>button:nth-last-child(1)
'
:
{
marginBottom
:
0
}
},
})
class
LeftToolbar
extends
React
.
Component
{
...
...
@@ -59,7 +71,8 @@ class LeftToolbar extends React.Component {
autoBind
(
this
)
this
.
state
=
{
width
:
0
width
:
0
,
hiddenButtonsPopup
:
null
}
this
.
controller
=
this
.
props
.
controller
...
...
@@ -84,7 +97,7 @@ class LeftToolbar extends React.Component {
renderSelectionContextToolbar
()
{
const
{
classes
,
buttonSize
}
=
this
.
props
const
{
width
}
=
this
.
state
const
{
width
,
hiddenButtonsPopup
}
=
this
.
state
const
ellipsisButtonSize
=
24
const
buttonsCount
=
5
...
...
@@ -147,31 +160,71 @@ class LeftToolbar extends React.Component {
]
const
ellipsisButton
=
(
<
IconButton
key
=
"
ellipsis
"
key
=
'
ellipsis
'
classes
=
{
{
root
:
classes
.
button
}
}
color
=
{
color
}
size
=
{
iconButtonSize
}
variant
=
"outlined"
variant
=
'outlined'
onClick
=
{
this
.
handleOpen
}
>
<
MoreIcon
/>
</
IconButton
>
);
)
const
popover
=
(
<
Popover
open
=
{
Boolean
(
hiddenButtonsPopup
)
}
anchorEl
=
{
hiddenButtonsPopup
}
onClose
=
{
this
.
handleClose
}
anchorOrigin
=
{
{
vertical
:
'
bottom
'
,
horizontal
:
'
left
'
}
}
transformOrigin
=
{
{
vertical
:
'
top
'
,
horizontal
:
'
left
'
}
}
>
<
Container
square
=
{
true
}
>
{
this
.
renderCollapsedButtons
(
buttons
.
slice
(
visibleButtonsCount
))
}
</
Container
>
</
Popover
>
)
return
(
<
div
className
=
{
classes
.
buttons
}
>
{
hideButtons
?
[...
buttons
.
slice
(
0
,
visibleButtonsCount
),
ellipsisButton
]
?
[...
buttons
.
slice
(
0
,
visibleButtonsCount
),
ellipsisButton
,
popover
]
:
buttons
}
</
div
>
);
}
renderCollapsedButtons
(
buttons
)
{
const
{
classes
}
=
this
.
props
return
(
<
div
className
=
{
classes
.
collapsedButtonsContainer
}
>
{
buttons
}
</
div
>
)
}
onResize
({
width
})
{
if
(
width
!==
this
.
state
.
width
)
{
this
.
setState
({
width
})
this
.
setState
({
width
,
hiddenButtonsPopup
:
null
})
}
}
handleOpen
(
event
)
{
this
.
setState
({
hiddenButtonsPopup
:
event
.
currentTarget
})
}
handleClose
()
{
this
.
setState
({
hiddenButtonsPopup
:
null
})
}
render
()
{
logger
.
log
(
logger
.
DEBUG
,
'
LeftToolbar.render
'
)
...
...
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