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) { ...@@ -34,14 +34,32 @@ function ($brickId, $brickUID, $row) {
// bad fix for getting the right attributes - like gridClass // bad fix for getting the right attributes - like gridClass
$Infinite->getBody(); $Infinite->getBody();
$Engine->assign(array(
'children' => $Infinite->getRow((int)$row), // generate rows
'row' => (int)$row, $loadingRows = 1;
'this' => $Infinite,
'gridClass' => $Infinite->getAttribute('gridClass') if (isset($settings['loadingrows'])
)); && !empty($settings['loadingrows'])
&& (int)$settings['loadingrows']
return $Engine->fetch($Infinite->getRowTemplate()); ) {
$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'), array('brickId', 'brickUID', 'row'),
false false
......
...@@ -89,27 +89,43 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [ ...@@ -89,27 +89,43 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
html: result html: result
}); });
var Row = Container.getElement( var Rows = Container.getElements(
'.quiqqer-bricks-children-infinite-row' '.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', 'float' : 'left',
opacity : 0, opacity : 0,
position: 'absolute', position: 'absolute',
overflow: 'hidden' 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, height : 0,
position: null position: null
}); });
var childrenCount = Row.getElements( var childrenCount = Rows.getLast().getElements(
'.quiqqer-bricks-children-infinite-child' '.quiqqer-bricks-children-infinite-child'
).length; ).length;
...@@ -123,7 +139,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [ ...@@ -123,7 +139,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
} }
moofx(Row).animate({ moofx(Rows).animate({
height : height, height : height,
opacity: 1 opacity: 1
}, { }, {
...@@ -142,7 +158,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [ ...@@ -142,7 +158,7 @@ define('package/quiqqer/bricks/bin/Controls/Children/Infinite', [
new Fx.Scroll(window.document).start( new Fx.Scroll(window.document).start(
0, 0,
Row.getPosition().y - 200 Rows[0].getPosition().y - 200
).chain(function () { ).chain(function () {
self.$More.focus(); self.$More.focus();
resolve(); resolve();
......
...@@ -278,6 +278,10 @@ ...@@ -278,6 +278,10 @@
<setting name="rows" type="number"> <setting name="rows" type="number">
<locale group="quiqqer/bricks" var="brick.control.Infinite.rows" /> <locale group="quiqqer/bricks" var="brick.control.Infinite.rows" />
</setting> </setting>
<setting name="loadingrows" type="number">
<locale group="quiqqer/bricks" var="brick.control.Infinite.loadingrows" />
</setting>
</settings> </settings>
</brick> </brick>
......
...@@ -378,6 +378,10 @@ ...@@ -378,6 +378,10 @@
<en><![CDATA[Number of rows]]></en> <en><![CDATA[Number of rows]]></en>
<pl><![CDATA[Liczba wierszy]]></pl> <pl><![CDATA[Liczba wierszy]]></pl>
</locale> </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"> <locale name="brick.control.Infinite.more.button">
<de><![CDATA[Mehr laden]]></de> <de><![CDATA[Mehr laden]]></de>
<en><![CDATA[more]]></en> <en><![CDATA[more]]></en>
......
{$children} {$children}
{if $showMoreBUtton} {if $showMoreButton}
<div class="button disabled"> <div class="button disabled">
{locale group="quiqqer/bricks" var="brick.control.Infinite.more.button"} {locale group="quiqqer/bricks" var="brick.control.Infinite.more.button"}
</div> </div>
......
...@@ -112,7 +112,7 @@ public function getBody() ...@@ -112,7 +112,7 @@ public function getBody()
$Engine->assign(array( $Engine->assign(array(
'this' => $this, 'this' => $this,
'children' => $children, 'children' => $children,
'showMoreBUtton' => $showMoreButton 'showMoreButton' => $showMoreButton
)); ));
return $Engine->fetch(dirname(__FILE__) . '/Infinite.html'); return $Engine->fetch(dirname(__FILE__) . '/Infinite.html');
......
{if count($children)}
<div data-row="{$row}" class="quiqqer-bricks-children-infinite-row"> <div data-row="{$row}" class="quiqqer-bricks-children-infinite-row">
{foreach from=$children item=Child} {foreach from=$children item=Child}
<div class="{$gridClass} mobile-grid-50 quiqqer-bricks-children-infinite-child"> <div class="{$gridClass} mobile-grid-50 quiqqer-bricks-children-infinite-child">
...@@ -24,4 +25,5 @@ ...@@ -24,4 +25,5 @@
</article> </article>
</div> </div>
{/foreach} {/foreach}
</div> </div>
\ No newline at end of file {/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