[showmore_dyn] Normalize addon use setting display with accordion behavior

pull/1066/head
Hypolite Petovan 2020-12-31 09:13:42 -05:00
parent 39280ea6bd
commit 14ebf55d56
2 changed files with 8 additions and 3 deletions

View File

@ -57,7 +57,7 @@ function showmore_dyn_settings(App &$a, &$o)
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/'); $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/showmore_dyn/');
$o .= Renderer::replaceMacros($t, [ $o .= Renderer::replaceMacros($t, [
'$submit' => DI::l10n()->t('Save Settings'), '$submit' => DI::l10n()->t('Save Settings'),
'$title' => 'Showmore Dynamic', '$header' => 'Show More Dynamic',
'$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal pixel height of posts, 0 to disable', '', '', 'number'], '$limitHeight' => ['limitHeight', DI::l10n()->t('Limit Height'), $limitHeight, 'The maximal pixel height of posts, 0 to disable', '', '', 'number'],
]); ]);

View File

@ -1,5 +1,10 @@
<div class="settings-block"> <span id="settings_showmore_dyn_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose('settings_showmore_dyn_expanded'); openClose('settings_showmore_dyn_inflated');">
<h3 class="settings-heading">{{$title}}</h3> <h3>{{$header}}</h3>
</span>
<div id="settings_showmore_dyn_expanded" class="settings-block" style="display: none;">
<span class="fakelink" onclick="openClose('settings_showmore_dyn_expanded'); openClose('settings_showmore_dyn_inflated');">
<h3>{{$header}}</h3>
</span>
{{include file="field_input.tpl" field=$limitHeight}} {{include file="field_input.tpl" field=$limitHeight}}
<div class="settings-submit-wrapper"> <div class="settings-submit-wrapper">