summaryrefslogtreecommitdiff
path: root/wikipedia/presenters
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2013-10-28 17:09:58 -0700
committerMatt Watson <mattdangerw@gmail.com>2013-10-28 18:34:30 -0700
commit93ac6f60e39455bff3fd0745b66a0a41b0fe04c8 (patch)
treef20a3203478eeea81690b18c1d2bb05c65261f4b /wikipedia/presenters
parent94aeaa82b10986acf448395f68cd5d13068db5da (diff)
Article lists scroll to top on page transition
Moved all the transition code to the view, because it made making the scroll up calls we need easier. Also think thats the right place for the scroll logic to live. Took some nice code from :tomato:'s spike to use signals on back button presses in the view. [endlessm/eos-sdk#348]
Diffstat (limited to 'wikipedia/presenters')
-rw-r--r--wikipedia/presenters/domain_wiki_presenter.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/wikipedia/presenters/domain_wiki_presenter.js b/wikipedia/presenters/domain_wiki_presenter.js
index 05af35e..97a142a 100644
--- a/wikipedia/presenters/domain_wiki_presenter.js
+++ b/wikipedia/presenters/domain_wiki_presenter.js
@@ -33,6 +33,10 @@ const DomainWikiPresenter = new Lang.Class({
Lang.bind(this, this._onCategoryClicked));
this._view.connect('article-chosen',
Lang.bind(this, this._onArticleClicked));
+ this._view.connect('category-back-clicked',
+ Lang.bind(this, this._onCategoryBackClicked));
+ this._view.connect('article-back-clicked',
+ Lang.bind(this, this._onArticleBackClicked));
this.initAppInfoFromJsonFile(app_filename);
this.initPageRankFromJsonFile(linked_articles_filename);
@@ -64,25 +68,21 @@ const DomainWikiPresenter = new Lang.Class({
this._view.set_category_info(newCategory, articles);
- this._view.transition_page(Endless.PageManagerTransitionType.SLIDE_LEFT,
- 'category');
+ this._view.show_category_page();
},
// Respond to the category page's 'article-clicked' signal by loading that
// article and switching to the article page
_onArticleClicked: function (articleList, title, uri) {
this._view.set_article_info(title, uri);
- this._view.transition_page(Endless.PageManagerTransitionType.SLIDE_LEFT,
- 'article');
+ this._view.show_article_page();
},
_onCategoryBackClicked: function(button) {
- this._view.transition_page(
- Endless.PageManagerTransitionType.SLIDE_RIGHT, 'front');
+ this._view.show_front_page();
},
_onArticleBackClicked: function(button) {
- this._view.transition_page(
- Endless.PageManagerTransitionType.SLIDE_RIGHT, 'category');
+ this._view.show_category_page();
}
}); \ No newline at end of file