Browse Source

wtf

pull/1/head
wes 7 years ago
parent
commit
5627d850bd
  1. 39
      ;

39
;

@ -1,39 +0,0 @@
<social>
<raw content={this.tweetHtml}>
</raw>
<script>
import './raw.tag';
import { default as _ } from 'lodash';
import { default as jquery } from 'jquery';
var self = this;
self.tweetHtml = "";
self._id = "";
updateButton(_id) {
if (_id == undefined) {
_id = self.opts.postid;
}
if (_id != self._id) {
self.tweetHtml = `<a class="twitter-share-button" data-show-count="false" href="https://primop.me/${_id}" ref="tweet">Tweet</a>`;
self._id = _id;
self.update();
}
}
window.twttr.ready((twttr) => {
console.log("initial load");
self.updateButton(self.opts.postid);
});
self.on("updated", () => {
if (window.twttr.widgets !== undefined) {
window.twttr.widgets.load();
}
});
</script>
</social>
Loading…
Cancel
Save