Skip to content

Commit a7ca997

Browse files
committed
minor tweaks
1 parent 2099171 commit a7ca997

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

docs/layouts.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,6 @@ echo '<div class="row">';
9494
foreach ($regionPanels as $region => $items) {
9595
echo '<div class="col-md-6">';
9696

97-
// hidden element to store the sort order
98-
echo \yii\helpers\Html::hiddenInput(
99-
'DashboardPanelSort[' . $region . ']',
100-
implode(',', \yii\helpers\ArrayHelper::map($items, 'options.id', 'options.id')),
101-
[
102-
'id' => 'input-dashboard-region-' . $region,
103-
]
104-
);
105-
10697
// sortable widget to enable drag-and-drop
10798
echo \kartik\sortable\Sortable::widget([
10899
'id' => 'dashboard-region-' . $region,
@@ -113,6 +104,15 @@ foreach ($regionPanels as $region => $items) {
113104
],
114105
]);
115106

107+
// hidden element to store the sort order
108+
echo \yii\helpers\Html::hiddenInput(
109+
'DashboardPanelSort[' . $region . ']',
110+
implode(',', \yii\helpers\ArrayHelper::map($items, 'options.id', 'options.id')),
111+
[
112+
'id' => 'input-dashboard-region-' . $region,
113+
]
114+
);
115+
116116
// create dashboard panel button
117117
echo '<div class="text-center">';
118118
echo \yii\helpers\Html::a('Create Dashboard Panel', [

src/views/dashboard/layouts/default/update.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626
echo '<div class="row">';
2727
foreach ($regionPanels as $region => $items) {
2828
echo '<div class="col-md-' . $span . '">';
29-
echo Html::hiddenInput('DashboardPanelSort[' . $region . ']', implode(',', ArrayHelper::map($items, 'options.id', 'options.id')), [
30-
'id' => 'input-dashboard-region-' . $region,
31-
]);
29+
30+
// sortable widget to enable drag-and-drop
3231
echo Sortable::widget([
3332
'id' => 'dashboard-region-' . $region,
3433
'connected' => true,
@@ -37,6 +36,13 @@
3736
'sortupdate' => 'dashboardPanelSort',
3837
],
3938
]);
39+
40+
// hidden element to store the sort order
41+
echo Html::hiddenInput('DashboardPanelSort[' . $region . ']', implode(',', ArrayHelper::map($items, 'options.id', 'options.id')), [
42+
'id' => 'input-dashboard-region-' . $region,
43+
]);
44+
45+
// create dashboard panel button
4046
echo '<div class="text-center">';
4147
echo Html::a(Yii::t('dashboard', 'Create Dashboard Panel'), [
4248
'dashboard-panel/create',
@@ -48,6 +54,7 @@
4854
]
4955
], ['class' => 'btn btn-default btn-sm']);
5056
echo '</div>';
57+
5158
echo '</div>';
5259
}
5360
echo '</div>';

0 commit comments

Comments
 (0)