Browse Source

add data-text with the title and attrib

pull/1/head
wes 7 years ago
parent
commit
892a9e1389
  1. 2
      src/scripts/post.tag
  2. 4
      src/scripts/social.tag

2
src/scripts/post.tag

@ -121,7 +121,7 @@ updatePost(postcontent) {
self.nextloading = "";
self.route(`/posts/${self._id}`);
self.refs.social.updateButton(self._id);
self.refs.social.updateButton(self._id, self.title);
self.one("updated", self.toTop);
self.update();

4
src/scripts/social.tag

@ -10,13 +10,13 @@ self.tweetHtml = "";
self._id = "";
updateButton(_id) {
updateButton(_id, title) {
if (_id == undefined) {
_id = self.opts.postid;
}
if (_id != self._id) {
self.tweetHtml = `<a style="display:none;" class="twitter-share-button" data-show-count="false" href="https://primop.me/${_id}" ref="tweet">Tweet ${_id}</a>`;
self.tweetHtml = `<a style="display:none;" class="twitter-share-button" data-text="${title} by @weskerfoot" data-show-count="false" data-url="https://primop.me/${_id}" ref="tweet">Tweet ${_id}</a>`;
self._id = _id;
self.update();
}

Loading…
Cancel
Save