Skip to content

Commit

Permalink
Merge pull request #1062 from pinterest/render-pin
Browse files Browse the repository at this point in the history
Fixing embedded pin render issues
  • Loading branch information
erwinmombay committed Dec 10, 2015
2 parents 3b050ea + cb31da4 commit 5d8b894
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions extensions/amp-pinterest/0.1/amp-pinterest.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class AmpPinterest extends AMP.BaseElement {

const structure = make({'span': {}});

const renderPin = function(r) {
const renderPin = function(self, r) {

if (r && r.data && r.data[0] && !r.data[0].error) {
const p = r.data[0];
Expand Down Expand Up @@ -338,19 +338,19 @@ class AmpPinterest extends AMP.BaseElement {
});

// fill it
this.applyFillContent(structure);
self.applyFillContent(structure);
// append it
this.element.appendChild(structure);
self.element.appendChild(structure);
// done
return loadPromise(img);
return loadPromise(structure);
}
};

const query = 'https://widgets.pinterest.com/v3/pidgets/pins/info/' +
'?pin_ids=' + pinId +
'&sub=www&base_scheme=https';
return call(query).then(r => {
return renderPin(r);
return renderPin(this, r);
});
};

Expand Down
2 changes: 1 addition & 1 deletion extensions/amp-pinterest/amp-pinterest.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Required when `data-do` is `buttonPin`. Contains the fully-qualified URL of the

Required when `data-do` is `buttonPin`. Contains the default description that appears in the pin create form; please choose carefully, since many Pinners will close the form without pinning if it doesn't make sense.

### Iframe Sizing for the Pin It Button
### Sizing the Pin It Button

Default small rectangular button:

Expand Down

0 comments on commit 5d8b894

Please sign in to comment.