Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
e82180e0
Commit
e82180e0
authored
6 years ago
by
Ben Wheeler
Browse files
Options
Downloads
Patches
Plain Diff
using project-id state for menu-bar's saving indicator
parent
d3011375
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/menu-bar/menu-bar.jsx
+3
-12
3 additions, 12 deletions
src/components/menu-bar/menu-bar.jsx
with
3 additions
and
12 deletions
src/components/menu-bar/menu-bar.jsx
+
3
−
12
View file @
e82180e0
...
...
@@ -138,22 +138,13 @@ class MenuBar extends React.Component {
'
handleRestoreOption
'
,
'
restoreOptionMessage
'
]);
this
.
state
=
{
projectSaveInProgress
:
false
};
}
component
WillReceiveProps
(
new
Props
)
{
component
DidUpdate
(
prev
Props
)
{
// if we're no longer showing the project (loading, or whatever), close menus
if
(
newP
rops
.
isShowingProject
&&
!
this
.
p
rops
.
isShowingProject
)
{
if
(
this
.
p
rops
.
isShowingProject
&&
!
prevP
rops
.
isShowingProject
)
{
this
.
props
.
onRequestCloseFile
();
this
.
props
.
onRequestCloseEdit
();
}
// if we're now saving, show save in progress
if
(
newProps
.
isSavingWithId
&&
!
this
.
props
.
isSavingWithId
)
{
this
.
setState
({
projectSaveInProgress
:
true
});
}
// if we're no longer saving, don't show save in progress
if
(
!
newProps
.
isSavingWithId
&&
this
.
props
.
isSavingWithId
)
{
this
.
setState
({
projectSaveInProgress
:
false
});
}
}
handleClickNew
()
{
if
(
this
.
props
.
sessionExists
&&
this
.
props
.
username
)
{
// logged in
...
...
@@ -240,7 +231,7 @@ class MenuBar extends React.Component {
className
=
{
classNames
(
this
.
props
.
className
,
styles
.
menuBar
,
{[
styles
.
saveInProgress
]:
this
.
state
.
projectSaveInProgress
}
{[
styles
.
saveInProgress
]:
this
.
props
.
isSavingWithId
}
)
}
>
<
div
className
=
{
styles
.
mainMenu
}
>
...
...
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