Skip to content

Instantly share code, notes, and snippets.

@Charuru
Created September 8, 2018 20:20
Show Gist options
  • Save Charuru/903a8c25cd0b661756bf400ac0d768bd to your computer and use it in GitHub Desktop.
Save Charuru/903a8c25cd0b661756bf400ac0d768bd to your computer and use it in GitHub Desktop.
ty.dulst.propertyValueChange = function(property, old, newString) {
ty.dulst.cardsInterface.cardCollection.each(function(card) {
var changeThisCard;
var out = card.get(property);
if (out && out === old) {
changeThisCard = true;
}
if (changeThisCard) {
console.log("attempting to update", card.get("title"));
card.save(property, newString, {
error: function() {},
success: function() {
console.log(
"updated",
card.get("title"),
"from",
old,
"to",
newString
);
}
});
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment