MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 152: Line 152:
}
}
    // Function to open the modal and adjust the list
// Function to open the modal and adjust the list
function openModal(cardElement) {
function openModal(cardElement) {
    console.log('Clicked on card:', cardElement);
    console.log('openModal called with:', cardElement);
    var isRelatedArticle = $(cardElement).hasClass('related-article');
    var isRelatedArticle = $(cardElement).hasClass('related-article');
    console.log('Is this a related article?:', isRelatedArticle);
    showArticleWrapper.css('display', 'block');
    showArticleWrapper.css('display', 'block');
    var wrapperWidth = showArticleWrapper.outerWidth(true);
    var wrapperWidth = showArticleWrapper.outerWidth(true);
    console.log('Wrapper width:', wrapperWidth);
    var adjustment = 25; // Adjust this value as needed to close the gap
    var adjustment = 25; // Adjust this value as needed to close the gap
    list.width(originalListWidth - wrapperWidth + adjustment).css('margin-right', (wrapperWidth - adjustment) + 'px');
    list.width(originalListWidth - wrapperWidth + adjustment).css('margin-right', (wrapperWidth - adjustment) + 'px');
Line 180: Line 182:
        var title = $(cardElement).find('.related-article-title').text();
        var title = $(cardElement).find('.related-article-title').text();
        var type = $(cardElement).find('.related-article-type').text();
        var type = $(cardElement).find('.related-article-type').text();
        console.log('Entry Number:', entryNumber);
        console.log('People:', people);
        console.log('Title:', title);
        console.log('Type:', type);
        // Update modal content for related-article
        // Update modal content for related-article
Line 287: Line 294:
    // Apply the fade-out effect to both #list and #list-list elements
    // Apply the fade-out effect to both #list and #list-list elements
    $('#list, #list-list').addClass('fade-out');
    $('#list, #list-list').addClass('fade-out');
   
    // End of openModal
}
}


Line 354: Line 363:
});
});


$(document).on('click', '.related-article', function() {
    openModal(this);
});


     function setupImageToggle(images) {
     function setupImageToggle(images) {

Navigation menu