Correzione icon-after nei checkbox
This commit is contained in:
parent
97393ac0b1
commit
bd1dd44c1b
|
@ -71,19 +71,17 @@ class ChoicesHandler implements HandlerInterface
|
|||
// Generazione del codice HTML
|
||||
// "+ this.checked" rende il valore booleano un numero
|
||||
$result = '
|
||||
<div class="form-group checkbox-group">
|
||||
<input type="hidden" name="|name|" value="|value|" class="openstamanager-input">
|
||||
<input type="checkbox" id="|id|" value="|value|" class="hidden" |attr| onchange="$(this).parent().find(\'[type = hidden]\').val(+this.checked).trigger(\'change\')"/>
|
||||
<div class="btn-group checkbox-buttons">
|
||||
<label for="|id|" class="btn btn-default'.$class.'">
|
||||
<span class="fa fa-check text-success"></span>
|
||||
<span class="fa fa-close text-danger"></span>
|
||||
</label>
|
||||
<label for="|id|" class="btn btn-default active'.$class.'">
|
||||
<span class="text-success">'.tr('Attivato').'</span>
|
||||
<span class="text-danger">'.tr('Disattivato').'</span>
|
||||
</label>
|
||||
</div>
|
||||
<input type="hidden" name="|name|" value="|value|" class="openstamanager-input">
|
||||
<input type="checkbox" id="|id|" value="|value|" class="hidden" |attr| onchange="$(this).parent().find(\'[type = hidden]\').val(+this.checked).trigger(\'change\')"/>
|
||||
<div class="btn-group checkbox-buttons">
|
||||
<label for="|id|" class="btn btn-default'.$class.'">
|
||||
<span class="fa fa-check text-success"></span>
|
||||
<span class="fa fa-close text-danger"></span>
|
||||
</label>
|
||||
<label for="|id|" class="btn btn-default active'.$class.'">
|
||||
<span class="text-success">'.tr('Attivato').'</span>
|
||||
<span class="text-danger">'.tr('Disattivato').'</span>
|
||||
</label>
|
||||
</div>';
|
||||
|
||||
return $result;
|
||||
|
|
|
@ -30,6 +30,10 @@ class HTMLWrapper implements WrapperInterface
|
|||
{
|
||||
$result = '';
|
||||
|
||||
if( $values['type']=='checkbox' ){
|
||||
$values['class'] = 'checkbox-group';
|
||||
}
|
||||
|
||||
// Valori particolari
|
||||
$values['icon-before'] = isset($values['icon-before']) ? $this->parser($values, $extras, $values['icon-before']) : null;
|
||||
$values['icon-after'] = isset($values['icon-after']) ? $this->parser($values, $extras, $values['icon-after']) : null;
|
||||
|
@ -37,7 +41,7 @@ class HTMLWrapper implements WrapperInterface
|
|||
// Generazione dell'etichetta
|
||||
if (!empty($values['label'])) {
|
||||
$result .= '
|
||||
<div class="form-group">
|
||||
<div class="form-group '.$values['class'].'">
|
||||
<label for="'.prepareToField($values['id']).'">'.(empty($values['help']) ? $values['label'] : '<span class="tip" title="'.prepareToField($values['help']).'">'.$values['label'].' <i class="fa fa-question-circle-o"></i></span>').'</label>';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue