Add a CSS class to photo cards for selection state.
Planning on adding some rules to make selected cards stand out in some way, or at least have that possibility.
This commit is contained in:
parent
9964cf987b
commit
70d0e64309
2 changed files with 8 additions and 5 deletions
|
@ -62,13 +62,16 @@ function apply_check(photo_card)
|
|||
whether the clipboard contains this card's ID.
|
||||
*/
|
||||
var checkbox = photo_card.getElementsByClassName("photo_card_selector_checkbox")[0];
|
||||
if (photo_clipboard.clipboard.has(photo_card.dataset.id))
|
||||
checkbox.checked = photo_clipboard.clipboard.has(photo_card.dataset.id);
|
||||
if (checkbox.checked)
|
||||
{
|
||||
checkbox.checked = true;
|
||||
photo_card.classList.remove("photo_card_unselected");
|
||||
photo_card.classList.add("photo_card_selected");
|
||||
}
|
||||
else
|
||||
{
|
||||
checkbox.checked = false;
|
||||
photo_card.classList.remove("photo_card_selected");
|
||||
photo_card.classList.add("photo_card_unselected");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{% macro create_photo_card(photo, view="grid") %}
|
||||
|
||||
{% if view == "list" %}
|
||||
<div class="photo_card photo_card_list" data-id="{{photo.id}}">
|
||||
<div class="photo_card photo_card_list photo_card_unselected" data-id="{{photo.id}}">
|
||||
<input type="checkbox" class="photo_card_selector_checkbox" onclick="photo_clipboard.on_photo_select(event)"/>
|
||||
<span class="photo_card_filename"><a target="_blank" href="/photo/{{photo.id}}">{{photo.basename}}</a></span>
|
||||
<a class="photo_card_metadata" target="_blank" href="{{photo|file_link}}">{{photo.bytestring}}</a>
|
||||
|
@ -56,7 +56,7 @@
|
|||
{% set metadata_inner = "{m}{d}, ".format(m=metadata_inner, d=photo.duration_string) %}
|
||||
{% endif -%}
|
||||
|
||||
<div class="photo_card photo_card_grid" data-id="{{photo.id}}">
|
||||
<div class="photo_card photo_card_grid photo_card_unselected" data-id="{{photo.id}}">
|
||||
<a class="photo_card_thumbnail" target="_blank" href="/photo/{{photo.id}}">
|
||||
<img src="{{thumbnail_src}}">
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue