summaryrefslogtreecommitdiffstats
path: root/js/directive
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-09-20 16:28:02 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-09-20 16:28:02 +0200
commit0d68f95aa6e2bc952052f1cd289fde0977cce006 (patch)
tree40af000c2194eae9eaa88bf3d793f83b992b069b /js/directive
parentedd87fa5791696167f0af75a7a95bdff8bdd0beb (diff)
fix #718
Diffstat (limited to 'js/directive')
-rw-r--r--js/directive/NewsArticleActions.js12
-rw-r--r--js/directive/NewsToggleShow.js24
2 files changed, 32 insertions, 4 deletions
diff --git a/js/directive/NewsArticleActions.js b/js/directive/NewsArticleActions.js
index 0b8714e41..516fd3a00 100644
--- a/js/directive/NewsArticleActions.js
+++ b/js/directive/NewsArticleActions.js
@@ -10,16 +10,20 @@
app.directive('newsArticleActions', function () {
'use strict';
return {
- restrict: 'E',
+ restrict: 'A',
scope: {
- 'article': '='
+ newsArticleActions: '='
},
link: function (scope, elem) {
var plugins = News.getArticleActionPlugins();
for (var i=0; i<plugins.length; i+=1) {
- plugins[i](elem, scope.article);
+ plugins[i](elem, scope.newsArticleActions);
+ }
+
+ if (plugins.length === 0) {
+ $('#app-content .more').hide();
}
}
};
-}); \ No newline at end of file
+});
diff --git a/js/directive/NewsToggleShow.js b/js/directive/NewsToggleShow.js
new file mode 100644
index 000000000..f448cad4e
--- /dev/null
+++ b/js/directive/NewsToggleShow.js
@@ -0,0 +1,24 @@
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+app.directive('newsToggleShow', function () {
+ 'use strict';
+ return {
+ restrict: 'A',
+ scope: {
+ 'newsToggleShow': '@'
+ },
+ link: function (scope, elem) {
+ elem.click(function () {
+ var target = $(scope.newsToggleShow);
+ target.toggle();
+ });
+ }
+ };
+});