mirror of
https://github.com/wallabag/wallabag.git
synced 2025-03-13 22:52:39 +00:00
Initialize filters and export sidenav with common ones
This commit is contained in:
parent
c71b5b01a9
commit
08aed94f44
3 changed files with 7 additions and 22 deletions
|
@ -27,7 +27,7 @@ import './js/highlight';
|
|||
|
||||
/* Tools */
|
||||
import {
|
||||
savePercent, retrievePercent, initExport, initFilters, initPreviewText,
|
||||
savePercent, retrievePercent, initPreviewText,
|
||||
} from './js/tools';
|
||||
|
||||
/* Import shortcuts */
|
||||
|
@ -273,7 +273,10 @@ const articleScroll = () => {
|
|||
|
||||
$(document).ready(() => {
|
||||
// sidenav
|
||||
$('.sidenav').sidenav();
|
||||
document.querySelectorAll('.sidenav').forEach((element) => {
|
||||
$(element).sidenav({ edge: element.getAttribute('data-edge') ?? 'left' });
|
||||
});
|
||||
|
||||
$('select').formSelect();
|
||||
$('.collapsible[data-collapsible="accordion"]').collapsible();
|
||||
$('.collapsible[data-collapsible="expandable"]').collapsible({
|
||||
|
@ -291,8 +294,6 @@ $(document).ready(() => {
|
|||
$('.tooltipped').tooltip();
|
||||
$('.fixed-action-btn').floatingActionButton();
|
||||
|
||||
initFilters();
|
||||
initExport();
|
||||
stickyNav();
|
||||
articleScroll();
|
||||
initPreviewText();
|
||||
|
|
|
@ -31,20 +31,6 @@ function retrievePercent(id, resized) {
|
|||
return true;
|
||||
}
|
||||
|
||||
function initFilters() {
|
||||
// no display if filters not available
|
||||
if ($('div').is('#filters')) {
|
||||
$('#filters.sidenav').sidenav({ edge: 'right' });
|
||||
}
|
||||
}
|
||||
|
||||
function initExport() {
|
||||
// no display if export not available
|
||||
if ($('div').is('#export')) {
|
||||
$('#export.sidenav').sidenav({ edge: 'right' });
|
||||
}
|
||||
}
|
||||
|
||||
function initPreviewText() {
|
||||
// no display if preview_text not available
|
||||
if ($('div').is('#preview-article')) {
|
||||
|
@ -64,7 +50,5 @@ function initPreviewText() {
|
|||
export {
|
||||
savePercent,
|
||||
retrievePercent,
|
||||
initExport,
|
||||
initFilters,
|
||||
initPreviewText,
|
||||
};
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
|
||||
<!-- Export -->
|
||||
{% if has_exports %}
|
||||
<div id="export" class="sidenav">
|
||||
<div id="export" class="sidenav" data-edge="right">
|
||||
{% set current_tag = null %}
|
||||
{% if tag is defined %}
|
||||
{% set current_tag = tag.slug %}
|
||||
|
@ -140,7 +140,7 @@
|
|||
|
||||
<!-- Filters -->
|
||||
{% if has_filters %}
|
||||
<div id="filters" class="sidenav">
|
||||
<div id="filters" class="sidenav" data-edge="right">
|
||||
<form action="{{ path('all') }}">
|
||||
|
||||
<h4 class="center">{{ 'entry.filters.title'|trans }}</h4>
|
||||
|
|
Loading…
Reference in a new issue