Skip to content

Commit

Permalink
Calculate width of widget icon in line to even spread them on one line.
Browse files Browse the repository at this point in the history
  • Loading branch information
drsdre committed Oct 23, 2015
1 parent adea99c commit 635f072
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions WizardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function run() {

// Wizard content
$wizard_line = '';
$wizard_line_distribution = round(100/(count($this->steps)+($this->complete_content?1:0)));
$tab_content = '';

// Navigation tracker
Expand All @@ -76,7 +77,7 @@ public function run() {
$class = 'disabled';
}

$wizard_line .= '<li role="presentation" class="'.$class.'">'.
$wizard_line .= '<li role="presentation" class="'.$class.'" style="width:'.$wizard_line_distribution.'%">'.
Html::a('<span class="round-tab"><i class="'.$step['icon'].'"></i></span>', '#step'.$id, [
'data-toggle' => 'tab',
'aria-controls' => 'step'.$id,
Expand Down Expand Up @@ -117,7 +118,7 @@ public function run() {
if ($this->start_step == 'completed') {
$class = 'active';
}
$wizard_line .= '<li role="presentation" class="'.$class.'">'.
$wizard_line .= '<li role="presentation" class="'.$class.'" style="width:'.$wizard_line_distribution.'%">'.
Html::a('<span class="round-tab"><i class="glyphicon glyphicon-ok"></i></span>', '#complete', [
'data-toggle' => 'tab',
'aria-controls' => 'complete',
Expand Down

0 comments on commit 635f072

Please sign in to comment.