Skip to content

Commit

Permalink
5.1.5
Browse files Browse the repository at this point in the history
add margintop to version parameter in xml
  • Loading branch information
conseilgouz committed Feb 4, 2024
1 parent 0742495 commit ac5732f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autoreadmore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<config>
<fields name="params" >
<fieldset name="basic" group="settings" label="JOPTIONS" addfieldprefix="ConseilGouz\Plugin\Content\Autoreadmore\Field">
<field name="version" type="version" extension="AUTOREADMORE" xml="/plugins/content/autoreadmore/autoreadmore.xml"/>
<field name="version" type="version" extension="AUTOREADMORE" xml="/plugins/content/autoreadmore/autoreadmore.xml" margintop="-3em"/>

<field name="debug" type="list" default="0" label="PLG_CONTENT_AUTOREADMORE_LIMITTYPE_LABEL_DEBUG">
<option value="0">JDISABLED</option>
Expand Down
12 changes: 10 additions & 2 deletions src/Field/VersionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @from https://github.com/gruz/AutoReadMore
* @author ConseilgGouz
* @copyright (C) 2023 www.conseilgouz.com. All Rights Reserved.
* @copyright (C) 2024 www.conseilgouz.com. All Rights Reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/

Expand Down Expand Up @@ -88,7 +88,15 @@ function getInput()
$css .= ".readonly.plg-desc {font-weight:normal;}";
$css .= "fieldset.radio label {width:auto;}";
$document->addStyleDeclaration($css);

$margintop = $this->def('margintop');
if (StringHelper::strlen($margintop)) {
$js = "document.addEventListener('DOMContentLoaded', function() {
vers = document.querySelector('.version');
parent = vers.parentElement.parentElement;
parent.style.marginTop = '".$margintop."';
})";
$document->addScriptDeclaration($js);
}
$return .= '<span class="version">' . Text::_('JVERSION') . ' ' . $version . "</span>";

return $return;
Expand Down

0 comments on commit ac5732f

Please sign in to comment.