Feature: Add basic frame for pin-resize

This commit is contained in:
winkidney
2019-02-25 21:47:43 +08:00
committed by Isaac Bythewood
parent 01bac724d6
commit 5a57cadcf3
6 changed files with 82 additions and 16 deletions

View File

@@ -8,14 +8,34 @@ function fetchPins(offset) {
Vue.component('pin', {
data: function () {
return {'loaded': false}
return {
'loaded': false,
'editable': true,
'active': false,
'textId': null,
}
},
props: ['pin'],
template: '#pin-template',
methods: {
onImageLoad: function () {
this.loaded = true;
}
this.$emit("resize", this.getTextHeight());
},
getAvatar: function () {
return "//gravatar.com/avatar/" + this.pin.submitter.gravatar;
},
getUserLink: function () {
return "/pins/users/" + this.pin.submitter.username + "/"
},
getTagLink: function (tag) {
return "/pins/tags/" + tag + "/"
},
getTextHeight: function() {
var element = this.$el;
var height = element.getBoundingClientRect().height;
return height
},
}
});