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
a76ee508
Commit
a76ee508
authored
Mar 12, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajax call to milestones via new dropdowns
parent
ff86138d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
4 deletions
+30
-4
app/assets/javascripts/issuable_context.js.coffee
app/assets/javascripts/issuable_context.js.coffee
+4
-1
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+17
-2
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+8
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
No files found.
app/assets/javascripts/issuable_context.js.coffee
View file @
a76ee508
...
@@ -14,7 +14,10 @@ class @IssuableContext
...
@@ -14,7 +14,10 @@ class @IssuableContext
block
=
$
(
@
).
parents
(
'.block'
)
block
=
$
(
@
).
parents
(
'.block'
)
block
.
find
(
'.selectbox'
).
show
()
block
.
find
(
'.selectbox'
).
show
()
block
.
find
(
'.value'
).
hide
()
block
.
find
(
'.value'
).
hide
()
block
.
find
(
'.js-select2'
).
select2
(
"open"
)
setTimeout
(
->
block
.
find
(
'.dropdown-menu-toggle'
).
trigger
'click'
),
0
$
(
".right-sidebar"
).
niceScroll
()
$
(
".right-sidebar"
).
niceScroll
()
...
...
app/assets/javascripts/milestone_select.js.coffee
View file @
a76ee508
...
@@ -11,6 +11,9 @@ class @MilestoneSelect
...
@@ -11,6 +11,9 @@ class @MilestoneSelect
useId
=
$dropdown
.
data
(
'use-id'
)
useId
=
$dropdown
.
data
(
'use-id'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
$selectbox
=
$dropdown
.
closest
(
'.selectbox'
)
$block
=
$selectbox
.
closest
(
'.block'
)
$value
=
$block
.
find
(
'.value'
)
$dropdown
.
glDropdown
(
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
data
:
(
term
,
callback
)
->
...
@@ -64,7 +67,7 @@ class @MilestoneSelect
...
@@ -64,7 +67,7 @@ class @MilestoneSelect
.
closest
(
'.selectbox'
)
.
closest
(
'.selectbox'
)
.
find
(
'input[type="hidden"]'
)
.
find
(
'input[type="hidden"]'
)
.
val
()
.
val
()
console
.
log
'gonna ajax it with'
,
url
:
issueUpdateURL
,
data
:
issue
:
milestone_id
:
selected
$
.
ajax
(
$
.
ajax
(
type
:
'PUT'
type
:
'PUT'
url
:
issueUpdateURL
url
:
issueUpdateURL
...
@@ -72,5 +75,17 @@ class @MilestoneSelect
...
@@ -72,5 +75,17 @@ class @MilestoneSelect
issue
:
issue
:
milestone_id
:
selected
milestone_id
:
selected
).
done
(
data
)
->
).
done
(
data
)
->
console
.
log
'databack'
,
data
$selectbox
.
hide
()
href
=
$value
.
show
()
.
find
(
'.milestone-title'
)
.
text
(
data
.
milestone
.
title
)
.
end
()
.
find
(
'a'
)
.
attr
(
'href'
)
splitHref
=
href
.
split
(
'/'
)
splitHref
[
splitHref
.
length
-
1
]
=
data
.
id
$value
.
find
(
'a'
)
.
attr
(
'href'
,
splitHref
.
join
(
'/'
))
)
)
\ No newline at end of file
app/assets/stylesheets/pages/issuable.scss
View file @
a76ee508
...
@@ -252,6 +252,14 @@
...
@@ -252,6 +252,14 @@
text-decoration
:
none
;
text-decoration
:
none
;
}
}
}
}
.dropdown-menu-toggle
{
width
:
100%
;
}
.open
.dropdown-menu
{
width
:
100%
;
}
}
}
.btn-default.gutter-toggle
{
.btn-default.gutter-toggle
{
...
...
app/controllers/projects/issues_controller.rb
View file @
a76ee508
...
@@ -108,7 +108,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -108,7 +108,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
end
end
end
format
.
json
do
format
.
json
do
render
json:
@issue
render
json:
@issue
.
to_json
(
include: :milestone
)
end
end
end
end
end
end
...
...
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