mirror of
https://github.com/flarum/core.git
synced 2025-05-06 15:35:38 +02:00
Extract method to get the permalink to a post
Necessary so that the embed extension can override it.
This commit is contained in:
parent
bb250baddf
commit
5e2f659f54
1498
js/forum/dist/app.js
vendored
1498
js/forum/dist/app.js
vendored
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,7 @@ export default class PostMeta extends Component {
|
|||||||
view() {
|
view() {
|
||||||
const post = this.props.post;
|
const post = this.props.post;
|
||||||
const time = post.time();
|
const time = post.time();
|
||||||
const permalink = window.location.origin + app.route.post(post);
|
const permalink = this.getPermalink(post);
|
||||||
const touch = 'ontouchstart' in document.documentElement;
|
const touch = 'ontouchstart' in document.documentElement;
|
||||||
|
|
||||||
// When the dropdown menu is shown, select the contents of the permalink
|
// When the dropdown menu is shown, select the contents of the permalink
|
||||||
@ -42,4 +42,14 @@ export default class PostMeta extends Component {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the permalink for the given post.
|
||||||
|
*
|
||||||
|
* @param {Post} post
|
||||||
|
* @returns {String}
|
||||||
|
*/
|
||||||
|
getPermalink(post) {
|
||||||
|
return window.location.origin + app.route.post(post);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user