diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-25 18:22:19 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-01-25 18:22:19 +0100 |
commit | 1ddbdffdb957992e1a32d001c5583de46e154662 (patch) | |
tree | c95b67ccd62543ac0ef66b415f5dcd453e80f3b6 /js/build/app.js | |
parent | 4b0ec60043b8fe0ebcfe86b5754dc8f594a5c26c (diff) |
Break client side plugin API to combat limitations that make it hard to impossible to get the DOM element
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/js/build/app.js b/js/build/app.js index ece6ba3cc..06b18f019 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2491,12 +2491,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); + } } }; }); |