Skip to content
Code-Schnipsel Gruppen Projekte
Commit 4afd9099 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: Infinite Children Brick besitzt neue Einstellung -> rowloading, es kann...

feat: Infinite Children Brick besitzt neue Einstellung -> rowloading, es kann bestimmt werden wieviel Reihen nachgeladen werden sollen
Übergeordneter 79ad5b59
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -34,14 +34,32 @@ function ($brickId, $brickUID, $row) {
// bad fix for getting the right attributes - like gridClass
$Infinite->getBody();
$Engine->assign(array(
'children' => $Infinite->getRow((int)$row),
'row' => (int)$row,
'this' => $Infinite,
'gridClass' => $Infinite->getAttribute('gridClass')
));
return $Engine->fetch($Infinite->getRowTemplate());
// generate rows
$loadingRows = 1;
if (isset($settings['loadingrows'])
&& !empty($settings['loadingrows'])
&& (int)$settings['loadingrows']
) {
$loadingRows = (int)$settings['loadingrows'];
}
$result = '';
for ($i = 0; $i < $loadingRows; $i++) {
$Engine->assign(array(
'children' => $Infinite->getRow((int)$row),
'row' => (int)$row,
'this' => $Infinite,
'gridClass' => $Infinite->getAttribute('gridClass')
));
$result .= $Engine->fetch($Infinite->getRowTemplate());
$row++;
}
return $result;
},
array('brickId', 'brickUID', 'row'),
false
......
......@@ -89,27 +89,43 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
html: result
});
var Row = Container.getElement(
var Rows = Container.getElements(
'.quiqqer-bricks-children-infinite-row'
);
Row.setStyles({
// no results founds
// hide more button and do nothing
if (!Rows.length) {
self.$More.removeEvents('click');
moofx(self.$More).animate({
cursor : 'default',
opacity: 0
});
return;
}
Rows.setStyles({
'float' : 'left',
opacity : 0,
position: 'absolute',
overflow: 'hidden'
});
Row.inject(self.$More, 'before');
Rows.each(function (Row) {
Row.inject(self.$More, 'before');
});
var height = Row.getSize().y;
var height = Rows[0].getSize().y;
Row.setStyles({
Rows.setStyles({
height : 0,
position: null
});
var childrenCount = Row.getElements(
var childrenCount = Rows.getLast().getElements(
'.quiqqer-bricks-children-infinite-child'
).length;
......@@ -123,7 +139,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
}
moofx(Row).animate({
moofx(Rows).animate({
height : height,
opacity: 1
}, {
......@@ -142,7 +158,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
new Fx.Scroll(window.document).start(
0,
Row.getPosition().y - 200
Rows[0].getPosition().y - 200
).chain(function () {
self.$More.focus();
resolve();
......
......@@ -278,6 +278,10 @@
<setting name="rows" type="number">
<locale group="quiqqer/bricks" var="brick.control.Infinite.rows" />
</setting>
<setting name="loadingrows" type="number">
<locale group="quiqqer/bricks" var="brick.control.Infinite.loadingrows" />
</setting>
</settings>
</brick>
......
......@@ -378,6 +378,10 @@
<en><![CDATA[Number of rows]]></en>
<pl><![CDATA[Liczba wierszy]]></pl>
</locale>
<locale name="brick.control.Infinite.loadingrows">
<de><![CDATA[Anzahl der Zeilen welche nachgeladen werden sollen]]></de>
<en><![CDATA[Number of rows that are to be loaded]]></en>
</locale>
<locale name="brick.control.Infinite.more.button">
<de><![CDATA[Mehr laden]]></de>
<en><![CDATA[more]]></en>
......
{$children}
{if $showMoreBUtton}
{if $showMoreButton}
<div class="button disabled">
{locale group="quiqqer/bricks" var="brick.control.Infinite.more.button"}
</div>
......
......@@ -112,7 +112,7 @@ public function getBody()
$Engine->assign(array(
'this' => $this,
'children' => $children,
'showMoreBUtton' => $showMoreButton
'showMoreButton' => $showMoreButton
));
return $Engine->fetch(dirname(__FILE__) . '/Infinite.html');
......
{if count($children)}
<div data-row="{$row}" class="quiqqer-bricks-children-infinite-row">
{foreach from=$children item=Child}
<div class="{$gridClass} mobile-grid-50 quiqqer-bricks-children-infinite-child">
......@@ -24,4 +25,5 @@
</article>
</div>
{/foreach}
</div>
\ No newline at end of file
</div>
{/if}
\ No newline at end of file
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren