Открыть боковую панель
nt_test134
nt_project_qgddddf2ot8w
Коммиты
d3ff691d
Коммит
d3ff691d
создал
Июн 02, 2016
по автору
Phil Hughes
Просмотр файлов
Fixed issue with dropdown toggle not updating
Added tests
владелец
f4eb5572
Изменения
3
Скрыть пробелы
Построчно
Рядом
app/assets/javascripts/gl_dropdown.js.coffee
Просмотр файла @
d3ff691d
...
...
@@ -211,6 +211,7 @@ class GitLabDropdown
@
dropdown
.
on
"shown.bs.dropdown"
,
@
opened
@
dropdown
.
on
"hidden.bs.dropdown"
,
@
hidden
$
(
@
el
).
on
"update.label"
,
@
updateLabel
@
dropdown
.
on
"click"
,
".dropdown-menu, .dropdown-menu-close"
,
@
shouldPropagate
@
dropdown
.
on
'keyup'
,
(
e
)
=>
if
e
.
which
is
27
# Escape key
...
...
@@ -453,7 +454,7 @@ class GitLabDropdown
# Toggle the dropdown label
if
@
options
.
toggleLabel
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggl
eLabel
@
updat
eLabel
()
else
selectedObject
else
if
el
.
hasClass
(
INDETERMINATE_CLASS
)
...
...
@@ -480,7 +481,7 @@ class GitLabDropdown
# Toggle the dropdown label
if
@
options
.
toggleLabel
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggl
eLabel
(
selectedObject
,
el
)
@
updat
eLabel
(
selectedObject
,
el
)
if
value
?
if
!
field
.
length
and
fieldName
@
addInput
(
fieldName
,
value
)
...
...
@@ -579,6 +580,9 @@ class GitLabDropdown
# Scroll the dropdown content up
$dropdownContent
.
scrollTop
(
listItemTop
-
dropdownContentTop
)
updateLabel
:
(
selected
=
null
,
el
=
null
)
=>
$
(
@
el
).
find
(
".dropdown-toggle-text"
).
text
@
options
.
toggleLabel
(
selected
,
el
)
$
.
fn
.
glDropdown
=
(
opts
)
->
return
@
.
each
->
if
(
!
$
.
data
@
,
'glDropdown'
)
...
...
app/assets/javascripts/issuable.js.coffee
Просмотр файла @
d3ff691d
...
...
@@ -54,6 +54,7 @@ issuable_created = false
# Submit the form to get new data
Issuable
.
filterResults
$
(
'.filter-form'
)
$
(
'.js-label-select'
).
trigger
(
'update.label'
)
toggleLabelFilters
:
->
$filteredLabels
=
$
(
'.filtered-labels'
)
...
...
spec/features/issues/filter_by_labels_spec.rb
Просмотр файла @
d3ff691d
...
...
@@ -174,4 +174,29 @@
expect
(
find
(
'.filtered-labels'
)).
not_to
have_content
"feature"
end
end
context
'remove filtered labels'
,
js:
true
do
before
do
page
.
within
'.labels-filter'
do
click_button
'Label'
click_link
'bug'
find
(
'.dropdown-menu-close'
).
click
end
page
.
within
'.filtered-labels'
do
expect
(
page
).
to
have_content
'bug'
end
end
it
'should allow user to remove filtered labels'
do
page
.
within
'.filtered-labels'
do
first
(
'.js-label-filter-remove'
).
click
expect
(
page
).
not_to
have_content
'bug'
end
page
.
within
'.labels-filter'
do
expect
(
page
).
not_to
have_content
'bug'
end
end
end
end
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать