Commit 693c26c2 authored by Jonathan Rehm's avatar Jonathan Rehm

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.
parent e1a88aa0
......@@ -6,7 +6,7 @@ $("#have_read_cb").on("change", function() {
$(this).closest("form").submit();
});
$(document).on("click", "[data-shelf-action]", function (e) {
$("#shelf-actions").on("click", "[data-shelf-action]", function (e) {
e.preventDefault();
$.get(this.href)
......
......@@ -183,7 +183,7 @@
{% if g.user.is_authenticated %}
{% 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">
<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')}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment