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

Add footer, matching functionality of header #813

Merged
merged 7 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ var CONFIG = {
* (optional)
*/
header: DEFAULT_HEADER,

/* footer: Matching functionality of header, but at the bottom instead of the top
* https://github.com/resoai/TileBoard/wiki/Header-configuration
* (optional)
*/
footer: DEFAULT_HEADER,
}
```

Expand Down
17 changes: 17 additions & 0 deletions index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,14 @@
<div ng-bind="group.title" class="group-title"></div>
<div tile ng-repeat="item in group.items track by $index"></div>
</div>

<div class="footer" ng-if="footer = getFooter(page)"
ng-include="'footer.html'"></div>
</div>
</div>

<div class="footer" ng-if="footer = getFooter()"
ng-include="'footer.html'"></div>
</div>

<div class="screensaver" ng-click="hideScreensaver()"
Expand Down Expand Up @@ -368,6 +374,17 @@
</div>
</script>

<script type="text/ng-template" id="footer.html">
<div class="footer-content" ng-style="footer.styles">
<div class="footer--left">
<div header-item ng-repeat="item in footer.left track by $index"></div>
</div>
<div class="footer--right">
<div header-item ng-repeat="item in footer.right track by $index"></div>
</div>
</div>
</script>

</body>

</html>
8 changes: 8 additions & 0 deletions scripts/controllers/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,14 @@ App.controller('Main', function ($scope, $timeout, $location, Api, tmhDynamicLoc
return page.header;
};

$scope.getFooter = function (page) {
rchl marked this conversation as resolved.
Show resolved Hide resolved
if (!page) {
return CONFIG.footer;
}

return page.footer;
};

function toSafeNumber (value) {
return !isNaN(+value) ? +value : null;
}
Expand Down
19 changes: 18 additions & 1 deletion styles/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ body {
}
}

.header {
.header,
.footer {
position: absolute;
z-index: 2;
left: 0;
Expand Down Expand Up @@ -414,6 +415,22 @@ body {
}
}

.footer {
bottom: 0px;
top: auto;
}
rchl marked this conversation as resolved.
Show resolved Hide resolved

.-menu-bottom {
.footer {
bottom: @pageBottomPaddingSmall;
}
@media (min-width: 500px) {
.footer {
bottom: @pageBottomPaddingBig;
}
}
}

.-menu-left {
&.-scrolled-horizontally {
.pages-menu--scroll-indicator {
Expand Down
9 changes: 9 additions & 0 deletions styles/themes.less
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,17 @@
.page {
padding-bottom: @pageBottomPaddingSmall + 2 * @winphonePageMenuIconBorderSize;
}
.footer {
bottom: @pageBottomPaddingSmall + 2 * @winphonePageMenuIconBorderSize;
}

@media (min-width: 500px) {
.page {
padding-bottom: @pageBottomPaddingBig + 2 * @winphonePageMenuIconBorderSize;
}
.footer {
bottom: @pageBottomPaddingBig + 2 * @winphonePageMenuIconBorderSize;
}
}
}
}
Expand Down Expand Up @@ -647,6 +653,9 @@
.page {
padding-bottom: @pageBottomPadding;
}
.footer {
bottom: @pageBottomPadding;
}
}

@sliderBorderRadius: 6px;
Expand Down