fix(feed_settings): make settings layout better

This commit is contained in:
Vladimir Barinov 2024-11-03 17:21:22 +03:00 committed by GitHub
parent 299dbd0755
commit 8f7a98c59e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,23 +86,43 @@ u(document).on('click', '#__feed_settings_link', (e) => {
const CURRENT_RETURN_BANNED = Number(__temp_url.searchParams.get('return_banned') ?? 0)
const COUNT = [1, 5, 10, 20, 30, 40, 50]
u('#_feed_settings_container #__content').html(`
<div class='settings_item'>
${tr('posts_per_page')}:
<table cellspacing="7" cellpadding="0" border="0" align="center">
<tbody>
<tr>
<td width="120" valign="top">
<span class="nobold">${tr('posts_per_page')}</span>
</td>
<td>
<select id="pageSelect"></select>
</div>
<div class='settings_item'>
${tr('start_from_page')}
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">${tr('start_from_page')}</span>
</td>
<td>
<input type='number' min='1' max='${PAGES_COUNT}' id='pageNumber' value='${CURRENT_PAGE}' placeholder='${CURRENT_PAGE}'>
</div>
<div class='settings_item'>
<label>
</td>
</tr>
<tr>
<td width="120" valign="top">
<span class="nobold">
<input type='checkbox' id="showIgnored" ${CURRENT_RETURN_BANNED == 1 ? 'checked' : ''}>
</span>
</td>
<td>
${tr('show_ignored_sources')}
</label>
</div>
<div class='final_settings_item'>
</td>
</tr>
<tr>
<td width="120" valign="top">
</td>
<td>
<input class='button' type='button' value='${tr('apply')}'>
</div>
</td>
</tr>
</tbody>
</table>
`)
u('#_feed_settings_container').on('click', '.final_settings_item input', (e) => {
@ -161,7 +181,10 @@ u(document).on('click', '#__feed_settings_link', (e) => {
}
if(window.openvk.ignored_list.response.items.length < 1) {
u('#_feed_settings_container #__content').html(tr('no_ignores_count'))
u('#_feed_settings_container #__content').html(`
<div class="information">
${tr('no_ignores_count')}
</div>`)
u('#_remove_ignores').remove()
}