mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 23:26:41 +02:00
Issue #369 partial fix - just needs a JS guru to hide the 'More..' button when the text is fully expanded.
This commit is contained in:
@@ -2531,11 +2531,12 @@ class e_form
|
|||||||
$ttl = vartrue($parms['expand']);
|
$ttl = vartrue($parms['expand']);
|
||||||
if($ttl == 1)
|
if($ttl == 1)
|
||||||
{
|
{
|
||||||
$ttl = "<button class='btn btn-mini pull-right'>More..</button>";
|
$ttl = $expand."<button class='btn btn-mini pull-right'>More..</button>";
|
||||||
// $expand = "";
|
$ttl1 = "<button class='btn btn-mini pull-right'>..Less</button>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$expands = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl, $ttl)."</a>";
|
$expands = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl, $ttl)."</a>";
|
||||||
|
$contracts = '<a href="#'.$elid.'-expand" class="e-show-if-js e-expandit">'.defset($ttl1, $ttl1)."</a>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2543,20 +2544,20 @@ class e_form
|
|||||||
if(vartrue($parms['truncate']))
|
if(vartrue($parms['truncate']))
|
||||||
{
|
{
|
||||||
$value = $oldval = strip_tags($value);
|
$value = $oldval = strip_tags($value);
|
||||||
$value = $tp->text_truncate($value, $parms['truncate'], $expand);
|
$value = $tp->text_truncate($value, $parms['truncate'], '');
|
||||||
$truncated = str_replace($expand,'',$value);
|
|
||||||
$toexpand = $value != $oldval;
|
$toexpand = $value != $oldval;
|
||||||
}
|
}
|
||||||
elseif(vartrue($parms['htmltruncate']))
|
elseif(vartrue($parms['htmltruncate']))
|
||||||
{
|
{
|
||||||
$value = $tp->html_truncate($value, $parms['htmltruncate'], $expand);
|
$value = $tp->html_truncate($value, $parms['htmltruncate'], '');
|
||||||
$toexpand = $value != $oldval;
|
$toexpand = $value != $oldval;
|
||||||
}
|
}
|
||||||
if($toexpand)
|
if($toexpand)
|
||||||
{
|
{
|
||||||
// force hide! TODO - core style .expand-c (expand container)
|
// force hide! TODO - core style .expand-c (expand container)
|
||||||
$value .= '<span class="expand-c" style="display: none" id="'.$elid.'-expand"><span>'.str_replace($truncated,' ',$oldval).'</span></span>';
|
// TODO: Hide 'More..' button when text fully displayed.
|
||||||
$value .= $expands; // Keep it at the bottom so it does't cut the sentence.
|
$value .= '<span class="expand-c" style="display: none" id="'.$elid.'-expand"><span>'.str_replace($value,'',$oldval).$contracts.'</span></span>';
|
||||||
|
$value .= $expands; // 'More..' button. Keep it at the bottom so it does't cut the sentence.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user