From 8bbabd61e600e0a4aee72377c962d9147db1d8e1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 31 May 2012 22:04:11 -0700 Subject: updating the feed reader to enable serialization Signed-off-by: Valerio Virgillito --- .../feed-reader/feed-entry.reel/feed-entry.html | 22 +++++------ .../feed-reader/feed-reader.reel/feed-reader.html | 43 ++++++++++------------ .../feed-reader/feed-reader.reel/feed-reader.js | 14 ++++++- 3 files changed, 41 insertions(+), 38 deletions(-) (limited to 'node_modules') diff --git a/node_modules/montage-google/feed-reader/feed-entry.reel/feed-entry.html b/node_modules/montage-google/feed-reader/feed-entry.reel/feed-entry.html index 6b2e51e2..8e9b3371 100644 --- a/node_modules/montage-google/feed-reader/feed-entry.reel/feed-entry.html +++ b/node_modules/montage-google/feed-reader/feed-entry.reel/feed-entry.html @@ -6,8 +6,7 @@ - + @@ -56,23 +53,23 @@ height: 120px; width: 380px; } - + .feed-entry { } - - + + -
- -
-
+
+ +
+
- - + +
diff --git a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js index 47a831eb..c066220e 100644 --- a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js +++ b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js @@ -8,6 +8,10 @@ var Montage = require("montage").Montage, exports.FeedReader = Montage.create(Component, { + _apiLoaded: { + value: false + }, + didCreate: { value: function() { var self = this; @@ -17,6 +21,8 @@ exports.FeedReader = Montage.create(Component, { google.load("feeds", "1", { callback: function() { console.log('google feeds api loaded'); + self._apiLoaded = true; + self.feedURL = self._feedURL; self.needsDraw = true; window.initGoogleAPI = null; } @@ -30,13 +36,16 @@ exports.FeedReader = Montage.create(Component, { _feedURL: {value: null}, feedURL: { + serializable: true, get: function() { return this._feedURL; }, set: function(value) { this._feedURL = value; // execute the search and get the entries - this._fetchFeed(); + if (this._apiLoaded) { + this._fetchFeed(); + } } }, @@ -49,6 +58,7 @@ exports.FeedReader = Montage.create(Component, { _feedDisplayMode: {value: null}, feedDisplayMode: { + serializable: true, get: function() { return this._feedDisplayMode; }, @@ -107,7 +117,7 @@ exports.FeedReader = Montage.create(Component, { self.addEntryAnimation(); self.entries = result.feed.entries; self.activeIndex = 0; - + } -- cgit v1.2.3