diff options
author | Pushkar Joshi | 2012-06-06 07:54:11 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-06-06 07:54:11 -0700 |
commit | cfa1402ac2ce831a83a9d4263d06c452c157a414 (patch) | |
tree | adb8f1f1ad1c4dd1e7e9eee1bd206f1ec338d20c /node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js | |
parent | 8606ee7ec851cb0a971e7556eba5d9386f1b3639 (diff) | |
parent | 5ba54dc275b07e7b2d0ed14751761d1e663d3d14 (diff) | |
download | ninja-cfa1402ac2ce831a83a9d4263d06c452c157a414.tar.gz |
Merge branch 'pentool' into brushtool
Diffstat (limited to 'node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js')
-rw-r--r-- | node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js | 22 |
1 files changed, 20 insertions, 2 deletions
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..34533d6d 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, | |||
8 | 8 | ||
9 | exports.FeedReader = Montage.create(Component, { | 9 | exports.FeedReader = Montage.create(Component, { |
10 | 10 | ||
11 | _apiLoaded: { | ||
12 | value: false | ||
13 | }, | ||
14 | |||
11 | didCreate: { | 15 | didCreate: { |
12 | value: function() { | 16 | value: function() { |
13 | var self = this; | 17 | var self = this; |
@@ -17,6 +21,8 @@ exports.FeedReader = Montage.create(Component, { | |||
17 | google.load("feeds", "1", { | 21 | google.load("feeds", "1", { |
18 | callback: function() { | 22 | callback: function() { |
19 | console.log('google feeds api loaded'); | 23 | console.log('google feeds api loaded'); |
24 | self._apiLoaded = true; | ||
25 | self.feedURL = self._feedURL; | ||
20 | self.needsDraw = true; | 26 | self.needsDraw = true; |
21 | window.initGoogleAPI = null; | 27 | window.initGoogleAPI = null; |
22 | } | 28 | } |
@@ -30,13 +36,16 @@ exports.FeedReader = Montage.create(Component, { | |||
30 | 36 | ||
31 | _feedURL: {value: null}, | 37 | _feedURL: {value: null}, |
32 | feedURL: { | 38 | feedURL: { |
39 | serializable: true, | ||
33 | get: function() { | 40 | get: function() { |
34 | return this._feedURL; | 41 | return this._feedURL; |
35 | }, | 42 | }, |
36 | set: function(value) { | 43 | set: function(value) { |
37 | this._feedURL = value; | 44 | this._feedURL = value; |
38 | // execute the search and get the entries | 45 | // execute the search and get the entries |
39 | this._fetchFeed(); | 46 | if (this._apiLoaded) { |
47 | this._fetchFeed(); | ||
48 | } | ||
40 | } | 49 | } |
41 | }, | 50 | }, |
42 | 51 | ||
@@ -49,6 +58,7 @@ exports.FeedReader = Montage.create(Component, { | |||
49 | 58 | ||
50 | _feedDisplayMode: {value: null}, | 59 | _feedDisplayMode: {value: null}, |
51 | feedDisplayMode: { | 60 | feedDisplayMode: { |
61 | serializable: true, | ||
52 | get: function() { | 62 | get: function() { |
53 | return this._feedDisplayMode; | 63 | return this._feedDisplayMode; |
54 | }, | 64 | }, |
@@ -107,7 +117,7 @@ exports.FeedReader = Montage.create(Component, { | |||
107 | self.addEntryAnimation(); | 117 | self.addEntryAnimation(); |
108 | self.entries = result.feed.entries; | 118 | self.entries = result.feed.entries; |
109 | self.activeIndex = 0; | 119 | self.activeIndex = 0; |
110 | 120 | ||
111 | } | 121 | } |
112 | 122 | ||
113 | 123 | ||
@@ -174,6 +184,14 @@ exports.FeedReader = Montage.create(Component, { | |||
174 | value: function() { | 184 | value: function() { |
175 | 185 | ||
176 | } | 186 | } |
187 | }, | ||
188 | |||
189 | serializeProperties: { | ||
190 | value: function(serializer) { | ||
191 | serializer.set("element", this.element); | ||
192 | serializer.set("feedURL", this.feedURL); | ||
193 | serializer.set("feedDisplayMode", this.feedDisplayMode); | ||
194 | } | ||
177 | } | 195 | } |
178 | 196 | ||
179 | }); | 197 | }); |