Jake Vanderwerf
2025-11-25 2a2303d1dccc120dd7aa5f6b6ade0f89e0064850
assets/js/dash/CRUD.js
@@ -18,9 +18,10 @@
      this.updateBulkOptions();
      // Initialize components
      this.store = window.jvbStore.register(
      const store = window.jvbStore.register(
         this.content,
         {
            storeName: this.content,
            keyPath: 'id',
            endpoint: 'content',
            headers: {
@@ -42,7 +43,9 @@
               order: 'desc'
            },
            TTL: 30 * 60 * 1000, //30 minutes cache
            showLoading: true,
         });
      this.store = store[this.content];
      this.status = 'all';
      this.filterTimeout = null;
@@ -411,6 +414,9 @@
               break;
         }
      }
      if (window.targetCheck(e, 'select[data-filter]')) {
         this.handleFilterChange(e);
      }
   }
   handleTableChange(e) {
      const row = e.target.closest('tr[data-id]');
@@ -562,7 +568,7 @@
      let filter = target.dataset.filter;
      if (filter === 'taxonomies') {
         let taxonomy = target.dataset.taxonomy;
         this.store.setFilter(`tax_${taxonomy}`, filter.value);
         this.store.setFilter(`tax_${taxonomy}`, target.value);
      } else {
         this[target.dataset.filter] = target.value;
         this.store.setFilter(target.dataset.filter, target.value);
@@ -654,18 +660,6 @@
   }
   setupFilters() {
      document.querySelectorAll('[data-filter]').forEach(filter => {
         this.settings.addSetting(filter)
         filter.addEventListener('change', (e) => {
            if (this.filterTimeout) {
               clearTimeout(this.filterTimeout);
            }
            this.filterTimeout = setTimeout(() => {
               this.filterHandler(e);
            }, 300);
         });
      });
      // Search
      const searchInput = document.querySelector('input[type="search"]');
      if (searchInput) {