BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0556d661
Commit
0556d661
authored
Apr 14, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Label dropdown and organize code
# Conflicts: # app/assets/javascripts/labels_select.js.coffee
parent
88ddce25
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
6 deletions
+13
-6
gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+5
-2
dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+1
-1
issuable.scss
app/assets/stylesheets/pages/issuable.scss
+4
-0
_label_page_create.html.haml
app/views/shared/issuable/_label_page_create.html.haml
+2
-2
_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
No files found.
app/assets/javascripts/gl_dropdown.js.coffee
View file @
0556d661
...
@@ -224,6 +224,9 @@ class GitLabDropdown
...
@@ -224,6 +224,9 @@ class GitLabDropdown
menu
.
toggleClass
PAGE_TWO_CLASS
menu
.
toggleClass
PAGE_TWO_CLASS
# Focus first visible input on active page
@
dropdown
.
find
(
'[class^="dropdown-page-"]:visible :text:visible:first'
).
focus
()
parseData
:
(
data
)
->
parseData
:
(
data
)
->
@
renderedData
=
data
@
renderedData
=
data
...
@@ -243,7 +246,8 @@ class GitLabDropdown
...
@@ -243,7 +246,8 @@ class GitLabDropdown
shouldPropagate
:
(
e
)
=>
shouldPropagate
:
(
e
)
=>
if
@
options
.
multiSelect
if
@
options
.
multiSelect
$target
=
$
(
e
.
target
)
$target
=
$
(
e
.
target
)
if
not
$target
.
hasClass
(
'dropdown-menu-close'
)
and
not
$target
.
hasClass
(
'dropdown-menu-close-icon'
)
if
not
$target
.
hasClass
(
'dropdown-menu-close'
)
and
not
$target
.
hasClass
(
'dropdown-menu-close-icon'
)
and
(
$target
.
attr
(
'href'
)
is
'#'
)
e
.
stopPropagation
()
e
.
stopPropagation
()
return
false
return
false
else
else
...
@@ -378,7 +382,6 @@ class GitLabDropdown
...
@@ -378,7 +382,6 @@ class GitLabDropdown
selectedObject
=
@
renderedData
[
selectedIndex
]
selectedObject
=
@
renderedData
[
selectedIndex
]
value
=
if
@
options
.
id
then
@
options
.
id
(
selectedObject
,
el
)
else
selectedObject
.
id
value
=
if
@
options
.
id
then
@
options
.
id
(
selectedObject
,
el
)
else
selectedObject
.
id
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
'][value='
#{
value
}
']"
)
field
=
@
dropdown
.
parent
().
find
(
"input[name='
#{
fieldName
}
'][value='
#{
value
}
']"
)
if
el
.
hasClass
(
ACTIVE_CLASS
)
if
el
.
hasClass
(
ACTIVE_CLASS
)
el
.
removeClass
(
ACTIVE_CLASS
)
el
.
removeClass
(
ACTIVE_CLASS
)
field
.
remove
()
field
.
remove
()
...
...
app/assets/stylesheets/framework/dropdowns.scss
View file @
0556d661
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
}
}
}
}
.dropdown-input-field
{
.dropdown-input-field
,
.default-dropdown-input
{
width
:
100%
;
width
:
100%
;
padding
:
0
7px
;
padding
:
0
7px
;
color
:
$dropdown-input-color
;
color
:
$dropdown-input-color
;
...
...
app/assets/stylesheets/pages/issuable.scss
View file @
0556d661
...
@@ -248,6 +248,10 @@
...
@@ -248,6 +248,10 @@
background
:
$gray-dark
;
background
:
$gray-dark
;
border
:
1px
solid
$border-gray-dark
;
border
:
1px
solid
$border-gray-dark
;
}
}
&
.btn-primary
{
@extend
.btn-primary
}
}
}
a
:not
(
.btn
)
{
a
:not
(
.btn
)
{
...
...
app/views/shared/issuable/_label_page_create.html.haml
View file @
0556d661
...
@@ -2,14 +2,14 @@
...
@@ -2,14 +2,14 @@
=
dropdown_title
(
"Create new label"
,
back:
true
)
=
dropdown_title
(
"Create new label"
,
back:
true
)
=
dropdown_content
do
=
dropdown_content
do
.dropdown-labels-error.js-label-error
.dropdown-labels-error.js-label-error
%input
#new_label_name
.d
ropdown-input-field
{
type:
"text"
,
placeholder:
"Name new label"
}
%input
#new_label_name
.d
efault-dropdown-input
{
type:
"text"
,
placeholder:
"Name new label"
}
.suggest-colors.suggest-colors-dropdown
.suggest-colors.suggest-colors-dropdown
-
suggested_colors
.
each
do
|
color
|
-
suggested_colors
.
each
do
|
color
|
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
&
nbsp
&
nbsp
.dropdown-label-color-input
.dropdown-label-color-input
.dropdown-label-color-preview.js-dropdown-label-color-preview
.dropdown-label-color-preview.js-dropdown-label-color-preview
%input
#new_label_color
.d
ropdown-input-field
{
type:
"text"
}
%input
#new_label_color
.d
efault-dropdown-input
{
type:
"text"
}
.clearfix
.clearfix
%button
.btn.btn-primary.pull-left.js-new-label-btn
{
type:
"button"
}
%button
.btn.btn-primary.pull-left.js-new-label-btn
{
type:
"button"
}
Create
Create
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
0556d661
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
-
issuable
.
labels
.
each
do
|
label
|
-
issuable
.
labels
.
each
do
|
label
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
.js-extra-options
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_json_path
(
issuable
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_json_path
(
issuable
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
Label
Label
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
...
...
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