]> git.wh0rd.org Git - tt-rss.git/commitdiff
js: add collapsed and expanded hooks
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 25 Apr 2013 06:09:40 +0000 (10:09 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 25 Apr 2013 06:09:40 +0000 (10:09 +0400)
js/PluginHost.js
js/viewfeed.js

index a3a31ce9c1baecbabc389f92016efb940cf93b26..de4c57b60bd80bfff0bee5c41671f086e713c489 100644 (file)
@@ -6,6 +6,8 @@ var PluginHost = {
        HOOK_ARTICLE_SET_ACTIVE: 3,
        HOOK_FEED_SET_ACTIVE: 4,
        HOOK_FEED_LOADED: 5,
+       HOOK_ARTICLE_EXPANDED: 6,
+       HOOK_ARTICLE_COLLAPSED: 7,
        hooks: [],
        register: function (name, callback) {
                if (typeof(this.hooks[name]) == 'undefined')
index 96919dc01d1958fb103ada34f8fcc11d69300a86..da869d92ab6b03c059f79d242bd33b75183cc69f 100644 (file)
@@ -1416,6 +1416,8 @@ function cdmCollapseArticle(event, id) {
                        }
 
                        if (event) Event.stop(event);
+
+                       PluginHost.run(PluginHost.HOOK_ARTICLE_COLLAPSED, id);
                }
 
        } catch (e) {
@@ -1503,6 +1505,8 @@ function cdmExpandArticle(id, noexpand) {
                toggleSelected(id);
                $("RROW-" + id).addClassName("active");
 
+               PluginHost.run(PluginHost.HOOK_ARTICLE_EXPANDED, id);
+
        } catch (e) {
                exception_error("cdmExpandArticle", e);
        }