Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
acbc75af
Commit
acbc75af
authored
Jan 06, 2017
by
ix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent <escape> key from confirming deletions
parent
f29d3893
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
list.html
flask_admin/templates/bootstrap3/admin/model/list.html
+17
-0
row_actions.html
...k_admin/templates/bootstrap3/admin/model/row_actions.html
+1
-1
No files found.
flask_admin/templates/bootstrap3/admin/model/list.html
View file @
acbc75af
...
...
@@ -202,5 +202,22 @@
);
{
%
endif
%
}
})(
jQuery
);
// Catch exception when closing dialog with
<
esc
>
key
// and prevent accidental deletions.
function
safeConfirm
(
msg
)
{
try
{
var
isconfirmed
=
confirm
(
msg
);
if
(
isconfirmed
==
true
)
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
err
)
{
return
false
;
}
}
</script>
{% endblock %}
flask_admin/templates/bootstrap3/admin/model/row_actions.html
View file @
acbc75af
...
...
@@ -31,7 +31,7 @@
{% elif csrf_token %}
<input
type=
"hidden"
name=
"csrf_token"
value=
"{{ csrf_token() }}"
/>
{% endif %}
<button
onclick=
"return
c
onfirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"Delete record"
>
<button
onclick=
"return
safeC
onfirm('{{ _gettext('Are you sure you want to delete this record?') }}');"
title=
"Delete record"
>
<span
class=
"fa fa-trash glyphicon glyphicon-trash"
></span>
</button>
</form>
...
...
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