1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-06-27 16:36:00 +00:00

Extract Leftbar and Add Tag controllers

This commit is contained in:
Yassine Guedidi 2025-03-08 15:31:15 +01:00
parent c9cfae11f7
commit a8cb9f4f77
5 changed files with 24 additions and 13 deletions

View file

@ -0,0 +1,13 @@
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static targets = ['input'];
toggle() {
this.element.classList.toggle('hidden');
if (!this.element.classList.contains('hidden')) {
this.inputTarget.focus();
}
}
}

View file

@ -0,0 +1,7 @@
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
toggleAddTagForm() {
this.dispatch('toggleAddTagForm');
}
}

View file

@ -128,12 +128,3 @@ import './scss/index.scss';
preferedColorScheme.init();
addDarkThemeListeners();
}());
$(document).ready(() => {
$('#nav-btn-add-tag').on('click', () => {
$('.nav-panel-add-tag').toggle();
$('.nav-panel-menu').addClass('hidden');
$('#tag_label').focus();
return false;
});
});