1
0
mirror of https://github.com/flarum/core.git synced 2025-07-27 19:50:20 +02:00

Allow the first post to be hidden

This commit is contained in:
Toby Zerner
2015-12-01 16:42:49 +10:30
parent d78bd82b65
commit d5970ee4a0

View File

@@ -81,6 +81,14 @@ app.initializers.replace('boot', () => {
mapRoutes(app.routes, basePath) mapRoutes(app.routes, basePath)
); );
if (m.route.param('hideFirstPost')) {
extend(PostStream.prototype, 'view', vdom => {
if (vdom.children[0].attrs['data-number'] === 1) {
vdom.children.splice(0, 1);
}
});
}
// Initialize FastClick, which makes links and buttons much more responsive on // Initialize FastClick, which makes links and buttons much more responsive on
// touch devices. // touch devices.
$(() => { $(() => {