Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
509bc3fb
Commit
509bc3fb
authored
Mar 27, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sidebar collapse update issue
parent
69789567
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
71 additions
and
18 deletions
+71
-18
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+4
-0
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+2
-0
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+5
-2
app/assets/javascripts/right_sidebar.js.coffee
app/assets/javascripts/right_sidebar.js.coffee
+53
-0
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+2
-16
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+4
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-0
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
509bc3fb
...
@@ -195,6 +195,8 @@ class GitLabDropdown
...
@@ -195,6 +195,8 @@ class GitLabDropdown
if
@
options
.
filterable
if
@
options
.
filterable
@
dropdown
.
find
(
".dropdown-input-field"
).
focus
()
@
dropdown
.
find
(
".dropdown-input-field"
).
focus
()
@
dropdown
.
trigger
(
'shown.gl.dropdown'
)
hidden
:
(
e
)
=>
hidden
:
(
e
)
=>
if
@
options
.
filterable
if
@
options
.
filterable
@
dropdown
@
dropdown
...
@@ -209,6 +211,8 @@ class GitLabDropdown
...
@@ -209,6 +211,8 @@ class GitLabDropdown
if
@
options
.
hidden
if
@
options
.
hidden
@
options
.
hidden
.
call
(
@
,
e
)
@
options
.
hidden
.
call
(
@
,
e
)
@
dropdown
.
trigger
(
'hidden.gl.dropdown'
)
# Render the full menu
# Render the full menu
renderMenu
:
(
html
)
->
renderMenu
:
(
html
)
->
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
509bc3fb
...
@@ -143,6 +143,7 @@ class @LabelsSelect
...
@@ -143,6 +143,7 @@ class @LabelsSelect
if
not
selected
.
length
if
not
selected
.
length
data
[
abilityName
].
label_ids
=
[
''
]
data
[
abilityName
].
label_ids
=
[
''
]
$loading
.
fadeIn
()
$loading
.
fadeIn
()
$dropdown
.
trigger
(
'loading.gl.dropdown'
)
$
.
ajax
(
$
.
ajax
(
type
:
'PUT'
type
:
'PUT'
url
:
issueUpdateURL
url
:
issueUpdateURL
...
@@ -150,6 +151,7 @@ class @LabelsSelect
...
@@ -150,6 +151,7 @@ class @LabelsSelect
data
:
data
data
:
data
).
done
(
data
)
->
).
done
(
data
)
->
$loading
.
fadeOut
()
$loading
.
fadeOut
()
$dropdown
.
trigger
(
'loaded.gl.dropdown'
)
$selectbox
.
hide
()
$selectbox
.
hide
()
data
.
issueURLSplit
=
issueURLSplit
data
.
issueURLSplit
=
issueURLSplit
labelCount
=
0
labelCount
=
0
...
...
app/assets/javascripts/milestone_select.js.coffee
View file @
509bc3fb
...
@@ -18,7 +18,7 @@ class @MilestoneSelect
...
@@ -18,7 +18,7 @@ class @MilestoneSelect
abilityName
=
$dropdown
.
data
(
'ability-name'
)
abilityName
=
$dropdown
.
data
(
'ability-name'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$block
=
$selectbox
.
closest
(
'.block'
)
$block
=
$selectbox
.
closest
(
'.block'
)
$sidebarCollapsedValue
=
$block
.
find
(
'.sidebar-collapsed-icon
span
'
)
$sidebarCollapsedValue
=
$block
.
find
(
'.sidebar-collapsed-icon'
)
$value
=
$block
.
find
(
'.value'
)
$value
=
$block
.
find
(
'.value'
)
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
...
@@ -99,11 +99,13 @@ class @MilestoneSelect
...
@@ -99,11 +99,13 @@ class @MilestoneSelect
data
[
abilityName
].
milestone_id
=
selected
data
[
abilityName
].
milestone_id
=
selected
$loading
$loading
.
fadeIn
()
.
fadeIn
()
$dropdown
.
trigger
(
'loading.gl.dropdown'
)
$
.
ajax
(
$
.
ajax
(
type
:
'PUT'
type
:
'PUT'
url
:
issueUpdateURL
url
:
issueUpdateURL
data
:
data
data
:
data
).
done
(
data
)
->
).
done
(
data
)
->
$dropdown
.
trigger
(
'loaded.gl.dropdown'
)
$loading
.
fadeOut
()
$loading
.
fadeOut
()
$selectbox
.
hide
()
$selectbox
.
hide
()
$value
.
removeAttr
(
'style'
)
$value
.
removeAttr
(
'style'
)
...
@@ -111,7 +113,8 @@ class @MilestoneSelect
...
@@ -111,7 +113,8 @@ class @MilestoneSelect
data
.
milestone
.
namespace
=
_this
.
currentProject
.
namespace
data
.
milestone
.
namespace
=
_this
.
currentProject
.
namespace
data
.
milestone
.
path
=
_this
.
currentProject
.
path
data
.
milestone
.
path
=
_this
.
currentProject
.
path
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
))
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
))
$sidebarCollapsedValue
.
text
(
data
.
milestone
.
title
)
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
data
.
milestone
.
title
)
else
else
$value
.
html
(
milestoneLinkNoneTemplate
)
$value
.
html
(
milestoneLinkNoneTemplate
)
$sidebarCollapsedValue
.
find
(
'span'
).
text
(
'No'
)
)
)
\ No newline at end of file
app/assets/javascripts/right_sidebar.js.coffee
0 → 100644
View file @
509bc3fb
class
@
Sidebar
constructor
:
(
currentUser
)
->
@
addEventListeners
()
addEventListeners
:
->
$
(
'aside'
).
on
(
'click'
,
'.sidebar-collapsed-icon'
,
@
sidebarCollapseClicked
)
$
(
'.dropdown'
).
on
(
'hidden.gl.dropdown'
,
@
sidebarDropdownHidden
)
$
(
'.dropdown'
).
on
(
'loading.gl.dropdown'
,
@
sidebarDropdownLoading
)
$
(
'.dropdown'
).
on
(
'loaded.gl.dropdown'
,
@
sidebarDropdownLoaded
)
sidebarDropdownLoading
:
(
e
)
->
$sidebarCollapsedIcon
=
$
(
@
).
closest
(
'.block'
).
find
(
'.sidebar-collapsed-icon'
)
img
=
$sidebarCollapsedIcon
.
find
(
'img'
)
i
=
$sidebarCollapsedIcon
.
find
(
'i'
)
$loading
=
$
(
'<i class="fa fa-spinner fa-spin"></i>'
)
if
img
.
length
img
.
before
(
$loading
)
img
.
hide
()
else
if
i
.
length
i
.
before
(
$loading
)
i
.
hide
()
sidebarDropdownLoaded
:
(
e
)
->
console
.
log
'loaded'
$sidebarCollapsedIcon
=
$
(
@
).
closest
(
'.block'
).
find
(
'.sidebar-collapsed-icon'
)
img
=
$sidebarCollapsedIcon
.
find
(
'img'
)
$sidebarCollapsedIcon
.
find
(
'i.fa-spin'
).
remove
()
i
=
$sidebarCollapsedIcon
.
find
(
'i'
)
if
img
.
length
img
.
show
()
else
i
.
show
()
sidebarCollapseClicked
:
(
e
)
->
e
.
preventDefault
()
$block
=
$
(
@
).
closest
(
'.block'
)
$
(
'aside'
)
.
find
(
'.gutter-toggle'
)
.
trigger
(
'click'
)
$editLink
=
$block
.
find
(
'.edit-link'
)
if
$editLink
.
length
$editLink
.
trigger
(
'click'
)
$block
.
addClass
(
'collapse-after-update'
)
sidebarDropdownHidden
:
(
e
)
->
$block
=
$
(
@
).
closest
(
'.block'
)
if
$block
.
hasClass
(
'collapse-after-update'
)
$block
.
removeClass
(
'collapse-after-update'
)
$
(
'aside'
)
.
find
(
'.gutter-toggle'
)
.
trigger
(
'click'
)
\ No newline at end of file
app/assets/javascripts/users_select.js.coffee
View file @
509bc3fb
...
@@ -17,9 +17,6 @@ class @UsersSelect
...
@@ -17,9 +17,6 @@ class @UsersSelect
issueURL
=
$dropdown
.
data
(
'issueUpdate'
)
issueURL
=
$dropdown
.
data
(
'issueUpdate'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$block
=
$selectbox
.
closest
(
'.block'
)
$block
=
$selectbox
.
closest
(
'.block'
)
$gutterToggle
=
$block
.
closest
(
'aside'
)
.
find
(
'.gutter-toggle'
)
abilityName
=
$dropdown
.
data
(
'ability-name'
)
abilityName
=
$dropdown
.
data
(
'ability-name'
)
$value
=
$block
.
find
(
'.value'
)
$value
=
$block
.
find
(
'.value'
)
$collapsedSidebar
=
$block
.
find
(
'.sidebar-collapsed-user'
)
$collapsedSidebar
=
$block
.
find
(
'.sidebar-collapsed-user'
)
...
@@ -30,28 +27,20 @@ class @UsersSelect
...
@@ -30,28 +27,20 @@ class @UsersSelect
assignTo
(
@
currentUser
.
id
)
assignTo
(
@
currentUser
.
id
)
)
)
$block
.
on
(
'click'
,
'.author_link'
,
(
e
)
=>
e
.
preventDefault
()
$gutterToggle
.
trigger
(
'click'
)
$block
.
find
(
'.edit-link'
)
.
trigger
(
'click'
)
$block
.
addClass
(
'collapse-after-update'
)
)
assignTo
=
(
selected
)
->
assignTo
=
(
selected
)
->
data
=
{}
data
=
{}
data
[
abilityName
]
=
{}
data
[
abilityName
]
=
{}
data
[
abilityName
].
assignee_id
=
selected
data
[
abilityName
].
assignee_id
=
selected
$loading
$loading
.
fadeIn
()
.
fadeIn
()
$dropdown
.
trigger
(
'loading.gl.dropdown'
)
$
.
ajax
(
$
.
ajax
(
type
:
'PUT'
type
:
'PUT'
dataType
:
'json'
dataType
:
'json'
url
:
issueURL
url
:
issueURL
data
:
data
data
:
data
).
done
(
data
)
->
).
done
(
data
)
->
$dropdown
.
trigger
(
'loaded.gl.dropdown'
)
$loading
.
fadeOut
()
$loading
.
fadeOut
()
$selectbox
.
hide
()
$selectbox
.
hide
()
...
@@ -67,9 +56,6 @@ class @UsersSelect
...
@@ -67,9 +56,6 @@ class @UsersSelect
avatar
:
''
avatar
:
''
$value
.
html
(
assigneeTemplate
(
user
))
$value
.
html
(
assigneeTemplate
(
user
))
$collapsedSidebar
.
html
(
collapsedAssigneeTemplate
(
user
))
$collapsedSidebar
.
html
(
collapsedAssigneeTemplate
(
user
))
if
$block
.
hasClass
(
'collapse-after-update'
)
$block
.
removeClass
(
'collapse-after-update'
)
$gutterToggle
.
trigger
(
'click'
)
collapsedAssigneeTemplate
=
_
.
template
(
collapsedAssigneeTemplate
=
_
.
template
(
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
509bc3fb
...
@@ -288,6 +288,10 @@
...
@@ -288,6 +288,10 @@
@media
(
min-width
:
$screen-sm-min
)
{
@media
(
min-width
:
$screen-sm-min
)
{
padding-right
:
$sidebar_collapsed_width
;
padding-right
:
$sidebar_collapsed_width
;
}
}
.sidebar-collapsed-icon
{
cursor
:
pointer
;
}
}
}
.right-sidebar-expanded
{
.right-sidebar-expanded
{
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
509bc3fb
...
@@ -150,3 +150,4 @@
...
@@ -150,3 +150,4 @@
new
LabelsSelect
();
new
LabelsSelect
();
new
IssuableContext
(
'
#{
current_user
.
to_json
(
only:
[
:username
,
:id
,
:name
])
}
'
);
new
IssuableContext
(
'
#{
current_user
.
to_json
(
only:
[
:username
,
:id
,
:name
])
}
'
);
new
Subscription
(
'
.subscription
'
)
new
Subscription
(
'
.subscription
'
)
new
Sidebar
();
\ No newline at end of file
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