Skip to content

Instantly share code, notes, and snippets.

@vadimdemedes
Last active December 15, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vadimdemedes/5195535 to your computer and use it in GitHub Desktop.
Save vadimdemedes/5195535 to your computer and use it in GitHub Desktop.
var asset = new Chute.API.Asset({ album: 'ALBUM_SHORTCUT', asset: 'ASSET_SHORTCUT' });
if(asset.hearted() == false) { // use hearted() method to check if asset was already hearted by this client before
asset.heart({ success: function(){
// asset hearted
}});
} else {
asset.unheart({ success: function(){
// asset unhearted
}});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment