Commit 584fc3f3 authored by Tobias Munk's avatar Tobias Munk

added DOM ids for cells and widgets; fixed test views

parent b2282a7b
...@@ -65,8 +65,8 @@ use yii\helpers\Html; ...@@ -65,8 +65,8 @@ use yii\helpers\Html;
<?= Html::a('Test page index', ['test/index'], ['class' => 'btn btn-default']) ?> <?= Html::a('Test page index', ['test/index'], ['class' => 'btn btn-default']) ?>
<?= Html::a('Test page-1 (with parameter)', ['test/with-param', 'id' => 'page-1'], ['class' => 'btn btn-default']) ?> <?= Html::a('Test page-1 (with parameter)', ['test/with-param', 'pageId' => 'page-1'], ['class' => 'btn btn-default']) ?>
<?= Html::a('Test page-2 (with parameter)', ['test/with-param', 'id' => 'page-2'], ['class' => 'btn btn-default']) ?> <?= Html::a('Test page-2 (with parameter)', ['test/with-param', 'pageId' => 'page-2'], ['class' => 'btn btn-default']) ?>
<?php \insolita\wgadminlte\Box::end() ?> <?php \insolita\wgadminlte\Box::end() ?>
{{ use ('hrzg/widget/widgets') }} {{ use ('hrzg/widget/widgets') }}
{{ widget_container_widget({id: 'header'}) }} {{ cell_widget({id: 'header'}) }}
<div class="container-fluid"> <div class="container-fluid">
{{ widget_container_widget({id: 'container'}) }} {{ cell_widget({id: 'container'}) }}
</div> </div>
\ No newline at end of file
...@@ -101,7 +101,9 @@ class Cell extends Widget ...@@ -101,7 +101,9 @@ class Cell extends Widget
{ {
$html = Html::beginTag( $html = Html::beginTag(
'div', 'div',
['class' => self::CSS_PREFIX.'-'.$this->id.' '.self::CSS_PREFIX.'-widget-container'] [
'id' => 'cell-'.$this->id,
'class' => self::CSS_PREFIX.'-'.$this->id.' '.self::CSS_PREFIX.'-widget-container']
); );
if (\Yii::$app->user->can('widgets')) { if (\Yii::$app->user->can('widgets')) {
...@@ -116,7 +118,7 @@ class Cell extends Widget ...@@ -116,7 +118,7 @@ class Cell extends Widget
if ($properties) { if ($properties) {
$class->setProperties($properties); $class->setProperties($properties);
} }
$html .= Html::beginTag('div', ['class' => 'hrzg-widget-widget']); $html .= Html::beginTag('div', ['id'=>'widget-'.($widget->name_id?:$widget->id), 'class' => 'hrzg-widget-widget']);
if (\Yii::$app->user->can('widgets')) { if (\Yii::$app->user->can('widgets')) {
$html .= $this->generateWidgetControls($widget); $html .= $this->generateWidgetControls($widget);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment