drop all size attributes (except SL size: small, large, medium), as it messes up too much

you can always set a width manually, if you don't want flex to share the width equally between input fields
Also removed automatic conversation of image to name attribute for new et2-button-icon, so our image setter can switch between our own icons and the SL icon library
This commit is contained in:
ralf 2022-08-23 11:12:10 +02:00
parent a73fa72764
commit ef599cb219
2 changed files with 6 additions and 14 deletions

View File

@ -22,7 +22,8 @@
<description for="ident_realname" value="Your name"/> <description for="ident_realname" value="Your name"/>
<hbox span="all"> <hbox span="all">
<textbox id="ident_realname" size="90" maxlength="128"/> <textbox id="ident_realname" size="90" maxlength="128"/>
<buttononly label="Placeholders" id="button[placeholders]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements&amp;nonavbar=1'),'_blank','dependent=yes,width=860,height=620,scrollbars=yes,status=yes'); return false;" options="dialog_help"/> <buttononly label="Placeholders" id="button[placeholders]" image="question-circle"
onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements&amp;nonavbar=1'),'_blank','dependent=yes,width=860,height=620,scrollbars=yes,status=yes'); return false;"/>
</hbox> </hbox>
</row> </row>
<row> <row>

View File

@ -324,17 +324,10 @@ function send_template()
unset($attrs['novalidation']); unset($attrs['novalidation']);
$attrs['noValidation'] = 'true'; $attrs['noValidation'] = 'true';
} }
// replace not set background_image attribute with et2-image tag, if not in NM / lists // replace not set background_image attribute with et2-button-icon tag, if not in NM / lists
if (!empty($attrs['image']) && (empty($attrs['background_image']) || $attrs['background_image'] === 'false') && if (!empty($attrs['image']) && (empty($attrs['background_image']) || $attrs['background_image'] === 'false'))
!preg_match('/^(index|list)/', $name))
{ {
$tag = 'et2-button-icon'; $tag = 'et2-button-icon';
if (!isset($attrs['name']))
{
$attrs['name'] = $attrs['image'];
unset($attrs['image']);
$attrs['library'] = 'egw';
}
} }
unset($attrs['background_image']); unset($attrs['background_image']);
return "<$tag " . stringAttrs($attrs) . '></' . $tag . '>'; return "<$tag " . stringAttrs($attrs) . '></' . $tag . '>';
@ -390,11 +383,9 @@ function send_template()
unset($attrs['class']); unset($attrs['class']);
} }
// Change size=# attribute to width, size is small|medium|large with Shoelace // Drop all (old) size attributes, if it's not shoelace size format: small, medium or large
// Do not drop size if we're setting shoelace size format in the template if (isset($attrs['size']) && !in_array($attrs['size'], ['small', 'medium', 'large']))
if (isset($attrs['size']) && !preg_match('/small|medium|large/',$attrs['size']))
{ {
$attrs['width'] = (int)$attrs['size'].'em';
unset($attrs['size']); unset($attrs['size']);
} }