Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ty.dulst.actionRename = function(old, newString) {
- ty.dulst.cardsInterface.cardCollection.each(function(card) {
- var changeThisCard;
- var effects = card.get("effects");
- if (effects && effects.length) {
- effects.forEach(function(effect) {
- if (effect.action.primary == old) {
- effect.action.primary = newString;
- changeThisCard = true;
- }
- });
- }
- if (changeThisCard) {
- console.log("attempting to update", card.get("title"));
- card.save("effects", effects, {
- error: function() {},
- success: function() {
- console.log(
- "updated",
- card.get("title"),
- "from",
- old,
- "to",
- newString
- );
- }
- });
- }
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement