summaryrefslogtreecommitdiffstats
path: root/js/directive
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-01-25 18:22:19 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-01-25 18:22:19 +0100
commit1ddbdffdb957992e1a32d001c5583de46e154662 (patch)
treec95b67ccd62543ac0ef66b415f5dcd453e80f3b6 /js/directive
parent4b0ec60043b8fe0ebcfe86b5754dc8f594a5c26c (diff)
Break client side plugin API to combat limitations that make it hard to impossible to get the DOM element
Diffstat (limited to 'js/directive')
-rw-r--r--js/directive/NewsArticleActions.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/js/directive/NewsArticleActions.js b/js/directive/NewsArticleActions.js
index b3468413f..daece216a 100644
--- a/js/directive/NewsArticleActions.js
+++ b/js/directive/NewsArticleActions.js
@@ -16,12 +16,14 @@ app.directive('newsArticleActions', function () {
'article': '='
},
replace: true,
- link: function (scope) {
- scope.plugins = News.getArticleActionPlugins();
- scope.pluginClick = function (pluginId, event, article) {
- News.getArticleActionPluginById(pluginId)
- .onClick(event, article);
- };
+ link: function (scope, elem) {
+ var plugins = News.getArticleActionPlugins();
+ scope.plugins = [];
+
+ for (var i=0; i<plugins.length; i+=1) {
+ var plugin = new plugins[i](elem, scope.article);
+ scope.plugins.push(plugin);
+ }
}
};
}); \ No newline at end of file