diff options
author | Simon Rettberg | 2019-03-25 11:46:50 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-03-25 11:46:50 +0100 |
commit | 03424ad19ac1bb42635a3d6653565aa0dc6ccf5a (patch) | |
tree | f3b068d5ca0aff6b897f98bb7eb7a5d097cec749 /modules-available/news | |
parent | [dozmod] How about implementing runscript deletion (diff) | |
download | slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.gz slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.tar.xz slx-admin-03424ad19ac1bb42635a3d6653565aa0dc6ccf5a.zip |
Introduce JS helper for bootstrap confirm dialogs on button-submit
Diffstat (limited to 'modules-available/news')
-rw-r--r-- | modules-available/news/templates/page-news.html | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules-available/news/templates/page-news.html b/modules-available/news/templates/page-news.html index b22b44f5..43afaf1a 100644 --- a/modules-available/news/templates/page-news.html +++ b/modules-available/news/templates/page-news.html @@ -57,7 +57,10 @@ </td> <td class="text-center"> <input type="hidden" name="news-type" value="news"> - <button {{perms.news.delete.disabled}} class="btn btn-danger btn-xs btn-delete" type="submit" name="newsid" value="{{newsid}}"><span class="glyphicon glyphicon-trash"></span></button> + <button {{perms.news.delete.disabled}} class="btn btn-danger btn-xs btn-delete" type="submit" + name="newsid" value="{{newsid}}" data-confirm="#confirm-delete" data-title="{{title}}"> + <span class="glyphicon glyphicon-trash"></span> + </button> </td> </tr> {{/list}} @@ -121,6 +124,7 @@ </div> </div> </div> +<div class="hidden" id="confirm-delete">{{lang_confirmDelete}}</div> <script type="application/javascript"><!-- document.addEventListener("DOMContentLoaded", function () { $('.sn-btn').click(function (event) { @@ -130,10 +134,5 @@ document.addEventListener("DOMContentLoaded", function () { } }); $('.summernote[readonly]').each(function() { $(this).summernote('disable'); }); - $('.btn-delete').click(function (event) { - if (confirm('{{lang_confirmDelete}}')) - return; - event.preventDefault(); - }); }, false); // --></script>
\ No newline at end of file |