Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions assets/js/odw-admin-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,45 +219,6 @@
observer.observe( document.body, { childList: true, subtree: true } );
}

// -------------------------------------------------------------------------
// Auto-show distribution fields when Tab 3 is activated
// -------------------------------------------------------------------------
function autoShowDistributionFields() {
// Only run once per page load
var ran = false;

function tryClickAddEntry() {
if ( ran ) {
return;
}

// The placeholder is only visible when there are no entries yet
var placeholder = document.querySelector( '.cf-complex__placeholder' );
if ( ! placeholder ) {
return;
}

// Find the "Add Entry" inserter button next to or after the placeholder
var inserterButton = document.querySelector( '.cf-complex__inserter-button' );
if ( ! inserterButton ) {
return;
}

ran = true;
inserterButton.click();
}

// Watch for Carbon Fields rendering the placeholder (lazy tab render)
var observer = new MutationObserver( function () {
tryClickAddEntry();
} );

observer.observe( document.body, { childList: true, subtree: true } );

// Also try immediately in case tab is already active
tryClickAddEntry();
}

// -------------------------------------------------------------------------
// Boot on DOMContentLoaded
// -------------------------------------------------------------------------
Expand All @@ -266,9 +227,6 @@
initCessdaAutosuggest();
initFileSizeWidgets();
observeNewGroups();

// Auto-show distribution fields if no entries exist
setTimeout( autoShowDistributionFields, 500 );
} );

} )();
4 changes: 2 additions & 2 deletions open-data-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Open Data Wizard
* Plugin URI: https://github.com/daimpad/OpenDataWizard
* Description: DCAT-AP 3.0 konforme Open Data Metadatenverwaltung für WordPress. Bereitstellung als maschinenlesbarer JSON-LD-Endpoint für offene Daten.
* Version: 2.1.2
* Version: 2.1.3
* Requires at least: 6.4
* Requires PHP: 8.1
* Author: nozilla
Expand All @@ -25,7 +25,7 @@
exit;
}

define( 'ODW_VERSION', '2.1.2' );
define( 'ODW_VERSION', '2.1.3' );
define( 'ODW_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'ODW_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'ODW_PLUGIN_FILE', __FILE__ );
Expand Down
Loading