]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
setActiveFeedId: assign feed/is-cat attributes to headlines-frame
[tt-rss.git] / js / tt-rss.js
index 7f8a7b61a0910fa269a4b6287ec8a2bd1c4f4657..ae5815b68de0f41f6054184e969804660af92344 100644 (file)
@@ -36,6 +36,9 @@ function setActiveFeedId(id, is_cat) {
                _active_feed_id = id;
                _active_feed_is_cat = is_cat;
 
+               $("headlines-frame").setAttribute("feed-id", id);
+               $("headlines-frame").setAttribute("is-cat", is_cat ? 1 : 0);
+
                selectFeed(id, is_cat);
        } catch (e) {
                exception_error("setActiveFeedId", e);
@@ -254,7 +257,7 @@ function init() {
                        onComplete: function(transport) {
                                        backend_sanity_check_callback(transport);
                                } });
-               
+
                hotkey_actions["next_feed"] = function() {
                                var rv = dijit.byId("feedTree").getNextFeed(
                                                getActiveFeedId(), activeFeedIsCat());
@@ -325,12 +328,12 @@ function init() {
                hotkey_actions["article_scroll_down"] = function() {
                                var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
 
-                               scrollArticle(ctr.offsetHeight/3);
+                               scrollArticle(40);
                };
                hotkey_actions["article_scroll_up"] = function() {
                                var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
 
-                               scrollArticle(-ctr.offsetHeight/3);
+                               scrollArticle(-40);
                };
                hotkey_actions["close_article"] = function() {
                                if (isCdmMode()) {
@@ -833,7 +836,11 @@ function hotkey_handler(e) {
                }
 
                var action = hotkey_actions[hotkey_action];
-               if(action != null) action();
+
+               if (action != null) {
+                       action();
+                       return false;
+               }
 
        } catch (e) {
                exception_error("hotkey_handler", e);