mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-27 21:37:40 +00:00
Attach events to button toolbar
Since this is closer to the elements, we can be more sure that we won't have events fire when we don't want them to. For example, if we're viewing the page in a modal, we don't want the event handler living longer than the content itself.
This commit is contained in:
@@ -6,7 +6,7 @@ $("#have_read_cb").on("change", function() {
|
|||||||
$(this).closest("form").submit();
|
$(this).closest("form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click", "[data-shelf-action]", function (e) {
|
$("#shelf-actions").on("click", "[data-shelf-action]", function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
$.get(this.href)
|
$.get(this.href)
|
||||||
|
|||||||
@@ -183,7 +183,7 @@
|
|||||||
|
|
||||||
{% if g.user.is_authenticated %}
|
{% if g.user.is_authenticated %}
|
||||||
{% if g.user.shelf.all() or g.public_shelfes %}
|
{% if g.user.shelf.all() or g.public_shelfes %}
|
||||||
<div class="btn-toolbar" role="toolbar">
|
<div id="shelf-actions" class="btn-toolbar" role="toolbar">
|
||||||
<div class="btn-group" role="group" aria-label="Add to shelves">
|
<div class="btn-group" role="group" aria-label="Add to shelves">
|
||||||
<button id="btnGroupDrop2" type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button id="btnGroupDrop2" type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span class="glyphicon glyphicon-list"></span> {{_('Add to shelf')}}
|
<span class="glyphicon glyphicon-list"></span> {{_('Add to shelf')}}
|
||||||
|
|||||||
Reference in New Issue
Block a user