Skip to content
This repository was archived by the owner on Nov 4, 2023. It is now read-only.

Commit 6979fcd

Browse files
cgarwoodrchl
authored andcommitted
feat: add optional footer, matching functionality of header (#813)
1 parent f0ccc11 commit 6979fcd

File tree

5 files changed

+58
-1
lines changed

5 files changed

+58
-1
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@ var CONFIG = {
162162
* (optional)
163163
*/
164164
header: DEFAULT_HEADER,
165+
166+
/* footer: Matching functionality of header, but at the bottom instead of the top
167+
* https://github.com/resoai/TileBoard/wiki/Header-configuration
168+
* (optional)
169+
*/
170+
footer: DEFAULT_HEADER,
165171
}
166172
```
167173

index.html.ejs

+17
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,14 @@
272272
<div ng-bind="group.title" class="group-title"></div>
273273
<div tile ng-repeat="item in group.items track by $index"></div>
274274
</div>
275+
276+
<div class="footer" ng-if="footer = getFooter(page)"
277+
ng-include="'footer.html'"></div>
275278
</div>
276279
</div>
280+
281+
<div class="footer" ng-if="footer = getFooter()"
282+
ng-include="'footer.html'"></div>
277283
</div>
278284

279285
<div class="screensaver" ng-click="hideScreensaver()"
@@ -368,6 +374,17 @@
368374
</div>
369375
</script>
370376

377+
<script type="text/ng-template" id="footer.html">
378+
<div class="footer-content" ng-style="footer.styles">
379+
<div class="footer--left">
380+
<div header-item ng-repeat="item in footer.left track by $index"></div>
381+
</div>
382+
<div class="footer--right">
383+
<div header-item ng-repeat="item in footer.right track by $index"></div>
384+
</div>
385+
</div>
386+
</script>
387+
371388
</body>
372389

373390
</html>

scripts/controllers/main.js

+8
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,14 @@ App.controller('Main', function ($scope, $timeout, $location, Api, tmhDynamicLoc
876876
return page.header;
877877
};
878878

879+
$scope.getFooter = function (page) {
880+
if (!page) {
881+
return CONFIG.footer;
882+
}
883+
884+
return page.footer;
885+
};
886+
879887
function toSafeNumber (value) {
880888
return !isNaN(+value) ? +value : null;
881889
}

styles/main.less

+18-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ body {
343343
}
344344
}
345345

346-
.header {
346+
.header,
347+
.footer {
347348
position: absolute;
348349
z-index: 2;
349350
left: 0;
@@ -414,6 +415,22 @@ body {
414415
}
415416
}
416417

418+
.footer {
419+
bottom: 0px;
420+
top: auto;
421+
}
422+
423+
.-menu-bottom {
424+
.footer {
425+
bottom: @pageBottomPaddingSmall;
426+
}
427+
@media (min-width: 500px) {
428+
.footer {
429+
bottom: @pageBottomPaddingBig;
430+
}
431+
}
432+
}
433+
417434
.-menu-left {
418435
&.-scrolled-horizontally {
419436
.pages-menu--scroll-indicator {

styles/themes.less

+9
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,17 @@
461461
.page {
462462
padding-bottom: @pageBottomPaddingSmall + 2 * @winphonePageMenuIconBorderSize;
463463
}
464+
.footer {
465+
bottom: @pageBottomPaddingSmall + 2 * @winphonePageMenuIconBorderSize;
466+
}
464467

465468
@media (min-width: 500px) {
466469
.page {
467470
padding-bottom: @pageBottomPaddingBig + 2 * @winphonePageMenuIconBorderSize;
468471
}
472+
.footer {
473+
bottom: @pageBottomPaddingBig + 2 * @winphonePageMenuIconBorderSize;
474+
}
469475
}
470476
}
471477
}
@@ -647,6 +653,9 @@
647653
.page {
648654
padding-bottom: @pageBottomPadding;
649655
}
656+
.footer {
657+
bottom: @pageBottomPadding;
658+
}
650659
}
651660

652661
@sliderBorderRadius: 6px;

0 commit comments

Comments
 (0)