UI: globalny auto-init Select2 z wyszukiwarka dla selectow >4 opcji
- Nowy libraries/adspro-select2-autoinit.js (auto-init na document.ready + ajaxComplete debounce 150ms) - Wyszukiwarka odblokowana dla "Grupa reklam", "Kampania", "Klient" na /campaign_terms (data-adspro-select2="true") - Globalne style Select2 w layout/style.scss i style.css (uogolnione z .products-page) - Usuniety duplikat: blok CSS .products-page .select2-* i funkcja init_products_scope_select_search() w products PAUL: phase 10-select2-global-search complete (plan 10-01) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -133,61 +133,6 @@
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.products-page .select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default .select2-selection--single {
|
||||
height: 38px;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 36px;
|
||||
padding-left: 12px;
|
||||
padding-right: 36px;
|
||||
font-size: 14px;
|
||||
color: #2d3748;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default .select2-selection--single .select2-selection__placeholder {
|
||||
color: #6c757d;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 36px;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default.select2-container--focus .select2-selection--single {
|
||||
border-color: #6690f4;
|
||||
box-shadow: 0 0 0 3px rgba(102, 144, 244, 0.1);
|
||||
}
|
||||
|
||||
.products-page .select2-dropdown {
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.products-page .select2-search--dropdown .select2-search__field {
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 6px;
|
||||
height: 34px;
|
||||
padding: 6px 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.products-page .select2-results__option {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.products-page .select2-container--default .select2-results__option--highlighted[aria-selected] {
|
||||
background-color: #6690f4;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.products-page .products-id-cell {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -607,29 +552,6 @@ function products_render_columns_picker( table_instance )
|
||||
}
|
||||
}
|
||||
|
||||
function init_products_scope_select_search()
|
||||
{
|
||||
if ( typeof $.fn.select2 === 'undefined' )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
[ '#products_campaign_id', '#products_ad_group_id' ].forEach( function( selector ) {
|
||||
var $select = $( selector );
|
||||
|
||||
if ( !$select.length || $select.data( 'products-select2-ready' ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$select.select2({
|
||||
width: '100%'
|
||||
});
|
||||
|
||||
$select.data( 'products-select2-ready', true );
|
||||
} );
|
||||
}
|
||||
|
||||
function products_breakdown_number( value, digits )
|
||||
{
|
||||
var num = Number( value || 0 );
|
||||
@@ -720,8 +642,6 @@ function products_build_breakdown_html( row_meta )
|
||||
|
||||
$( function()
|
||||
{
|
||||
init_products_scope_select_search();
|
||||
|
||||
var products_table = new DataTable( '#products', {
|
||||
stateSave: true,
|
||||
ajax: {
|
||||
|
||||
Reference in New Issue
Block a user