Jump to navigation
Hydro S.R.L. (Italy) v. Republic of Albania, Award
Hydro S.R.L. (Italy) v. Republic of Albania (II), ICC Case No. 20654/EMT/GR
jQ(document).ready(function() {
/* --- 1. SEARCH BAR & ACCORDION ENGINE --- */
var formWidgets = jQ('form[id^="views-exposed-form-search"] .views-exposed-widgets');
if (formWidgets.length > 0) {
var mainSearchInput = formWidgets.find('input[type="text"]').first();
var mainSearch = mainSearchInput.closest('.views-exposed-widget');
if (mainSearchInput.length > 0) {
mainSearchInput.attr('placeholder', 'Type to search...');
}
var submitBtn = formWidgets.find('.views-submit-button');
var resetBtn = formWidgets.find('.views-reset-button');
if (mainSearch.length > 0) {
mainSearch.find('label').hide();
}
formWidgets.css({
'display': 'flex', 'flex-direction': 'column', 'align-items': 'center', 'width': '100%'
});
if (jQ('.italaw-search-row-1').length === 0 && mainSearch.length > 0) {
var row1 = jQ('');
formWidgets.prepend(row1);
mainSearch.css({ 'margin': '0', 'width': '100%', 'max-width': '480px', 'flex': '0 1 480px' });
row1.append(mainSearch);
}
if (jQ('.italaw-search-row-2').length === 0) {
var row2 = jQ('');
row2.append(submitBtn).append(resetBtn);
jQ('.italaw-search-row-1').after(row2);
}
var metadataFilters = formWidgets.find('.views-exposed-widget').not(mainSearch).not('.views-submit-button').not('.views-reset-button').not('.italaw-search-row-1').not('.italaw-search-row-2');
if (metadataFilters.length > 0 && jQ('.italaw-adv-toggle-wrapper').length === 0 && mainSearch.length > 0) {
var toggleWrapper = jQ('▶ Advanced Search Options
');
jQ('.italaw-search-row-1').append(toggleWrapper);
var accordionBox = jQ('
Select any filter and click on Apply to see results
');
jQ('.italaw-search-row-2').after(accordionBox);
var grid = accordionBox.find('.italaw-facet-grid');
metadataFilters.each(function() {
jQ(this).appendTo(grid).css({ 'float': 'none', 'padding': '0', 'margin': '0', 'width': '100%' });
jQ(this).find('label').css({ 'font-size': '14px', 'color': '#2b81cf', 'font-weight': 'bold', 'margin-bottom': '8px', 'display': 'block' });
});
toggleWrapper.find('.italaw-adv-toggle').on('click', function() {
jQ('.italaw-advanced-accordion').slideToggle(300);
var icon = jQ(this).find('.toggle-icon');
icon.text(icon.text() === '▶' ? '▼' : '▶');
});
}
}
});
/* --- 2. CONTRIBUTE DOCUMENTS: PROGRESSIVE REVEAL ENGINE --- */
(function ($) {
Drupal.behaviors.italawFileFlow = {
attach: function (context, settings) {
var $fileComponents = jQ('.webform-component-file', context);
var nextToShow = false;
$fileComponents.each(function(i) {
var $this = jQ(this);
// Check if file is already uploaded or selected in browser
var hasContent = $this.find('.file').length > 0 || $this.find('input[type="file"]').val() !== "";
if (hasContent) {
$this.attr('style', 'display: block !important');
} else if (!nextToShow) {
// Show the first available empty slot
$this.attr('style', 'display: block !important');
nextToShow = true;
} else {
// Strictly hide all others
$this.attr('style', 'display: none !important');
}
});
// listener for the "Choose File" event
$fileComponents.find('input[type="file"]').once('reveal-logic').on('change', function() {
if (jQ(this).val() !== "") {
jQ(this).closest('.webform-component-file').next('.webform-component-file')
.stop().slideDown(400).attr('style', 'display: block !important');
}
});
}
};
})(jQuery);