Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
b60e5fdb
Kaydet (Commit)
b60e5fdb
authored
Mar 06, 2018
tarafından
Josh Schneier
Kaydeden (comit)
Tim Graham
Mar 16, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #28959 -- Fixed 'No, take me back' button on admin's inline popup.
üst
9421aee3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
cancel.js
django/contrib/admin/static/admin/js/cancel.js
+5
-1
tests.py
tests/admin_views/tests.py
+14
-0
No files found.
django/contrib/admin/static/admin/js/cancel.js
Dosyayı görüntüle @
b60e5fdb
...
...
@@ -3,7 +3,11 @@
$
(
function
()
{
$
(
'.cancel-link'
).
on
(
'click'
,
function
(
e
)
{
e
.
preventDefault
();
window
.
history
.
back
();
if
(
window
.
location
.
search
.
indexOf
(
'&_popup=1'
)
===
-
1
)
{
window
.
history
.
back
();
// Go back if not a popup.
}
else
{
window
.
close
();
// Otherwise, close the popup.
}
});
});
})(
django
.
jQuery
);
tests/admin_views/tests.py
Dosyayı görüntüle @
b60e5fdb
...
...
@@ -4394,6 +4394,20 @@ class SeleniumTests(AdminSeleniumTestCase):
self
.
assertEqual
(
select
.
first_selected_option
.
text
,
'---------'
)
self
.
assertEqual
(
select
.
first_selected_option
.
get_attribute
(
'value'
),
''
)
def
test_inline_with_popup_cancel_delete
(
self
):
"""Clicking ""No, take me back" on a delete popup closes the window."""
parent
=
ParentWithUUIDPK
.
objects
.
create
(
title
=
'test'
)
related_with_parent
=
RelatedWithUUIDPKModel
.
objects
.
create
(
parent
=
parent
)
self
.
admin_login
(
username
=
'super'
,
password
=
'secret'
,
login_url
=
reverse
(
'admin:index'
))
change_url
=
reverse
(
'admin:admin_views_relatedwithuuidpkmodel_change'
,
args
=
(
related_with_parent
.
id
,))
self
.
selenium
.
get
(
self
.
live_server_url
+
change_url
)
self
.
selenium
.
find_element_by_id
(
'delete_id_parent'
)
.
click
()
self
.
wait_for_popup
()
self
.
selenium
.
switch_to
.
window
(
self
.
selenium
.
window_handles
[
-
1
])
self
.
selenium
.
find_element_by_xpath
(
'//a[text()="No, take me back"]'
)
.
click
()
self
.
selenium
.
switch_to
.
window
(
self
.
selenium
.
window_handles
[
0
])
self
.
assertEqual
(
len
(
self
.
selenium
.
window_handles
),
1
)
def
test_list_editable_raw_id_fields
(
self
):
parent
=
ParentWithUUIDPK
.
objects
.
create
(
title
=
'test'
)
parent2
=
ParentWithUUIDPK
.
objects
.
create
(
title
=
'test2'
)
...
...
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