refresh products list suggestion colspan when screen options change

This commit is contained in:
haszari 2019-03-06 14:44:58 +13:00
parent d0fd15ea8c
commit f944da3eac
2 changed files with 10 additions and 1 deletions

View File

@ -198,6 +198,7 @@
row.dataset.suggestionSlug = slug;
var cell = document.createElement( 'td' );
cell.classList.add( 'marketplace-table-banner-td' );
cell.setAttribute( 'colspan', getTableBannerColspan() );
var container = document.createElement( 'div' );
@ -309,6 +310,12 @@
}
}
function refreshBannerColspanForScreenOptions( content ) {
$( '#show-settings-link' ).on( 'focus.scroll-into-view', function() {
$( '.marketplace-table-banner-td' ).attr( 'colspan', getTableBannerColspan() );
});
}
// Render suggestion data in appropriate places in UI.
function displaySuggestions( marketplaceSuggestionsApiData ) {
var usedSuggestionsContexts = [];
@ -418,6 +425,8 @@
usedSuggestionsContexts.push( context );
refreshBannerColspanForScreenOptions( content );
window.wcTracks.recordEvent( 'marketplace_suggestion_displayed', {
suggestionSlug: suggestionToDisplay.slug
} );

File diff suppressed because one or more lines are too long