Permalink
Browse files

Update the transfer link on load, too

  • Loading branch information...
1 parent 7abb3c9 commit d2789e06ad5017164298092d336061942b999271 Jonathan Penn committed Jan 8, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/assets/javascripts/models/favorites.js
@@ -34,6 +34,11 @@ var FavoritesCollection = Backbone.Model.extend({
save: function() {
var favoritesString = JSON.stringify(this._favorites);
window.localStorage['favorites'] = favoritesString;
+ this.updateTransferLink();
+ },
+
+ updateTransferLink: function() {
+ var favoritesString = JSON.stringify(this._favorites);
var transferUrl = [
location.protocol + "//",
location.host,
@@ -49,6 +54,7 @@ var FavoritesCollection = Backbone.Model.extend({
var parsed = JSON.parse(data);
if (parsed) this._favorites = parsed;
}
+ this.updateTransferLink();
},
parse: function(hashId) {

0 comments on commit d2789e0

Please sign in to comment.