You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
730 B
35 lines
730 B
<social>
|
|
<div class="social-wrapper">
|
|
<raw ref="button" content={this.tweetHtml}>
|
|
</raw>
|
|
</div>
|
|
<script>
|
|
|
|
import './raw.tag';
|
|
var self = this;
|
|
|
|
self.tweetHtml = "";
|
|
|
|
self._id = "";
|
|
|
|
updateButton(_id, title) {
|
|
if (_id == undefined) {
|
|
_id = self.opts.postid;
|
|
}
|
|
if (_id != self._id) {
|
|
|
|
self.tweetHtml = `<a style="display:none;" data-size="large" class="btn twitter-share-button" data-text="${title}" data-via="weskerfoot" data-show-count="false" data-url="https://primop.me/blog/#!posts/${_id}" ref="tweet">Tweet ${_id}</a>`;
|
|
self._id = _id;
|
|
self.update();
|
|
}
|
|
}
|
|
|
|
self.on("updated", () => {
|
|
if (window.twttr.widgets !== undefined) {
|
|
|
|
window.twttr.widgets.load();
|
|
}
|
|
});
|
|
|
|
</script>
|
|
</social>
|
|
|