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

Commit

Permalink
feat: add optional footer, matching functionality of header (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgarwood authored and rchl committed Feb 3, 2022
1 parent f0ccc11 commit 6979fcd
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 1 deletion.
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) {
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;
}

.-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

0 comments on commit 6979fcd

Please sign in to comment.