summaryrefslogtreecommitdiffstats
path: root/js/controller
diff options
context:
space:
mode:
authorAurélien <dav.aurelien@gmail.com>2021-03-14 22:11:24 +0100
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-04-08 23:17:31 +0200
commit2e316f8f641f2cd48511ee57ffa9d031db34af39 (patch)
tree6d3b14a1a8cb12aa5c562ed6a25cb7d9e05646e8 /js/controller
parent792082e2e0fcca32fffc7693a210ae2fa64d4c06 (diff)
Add directive ClickOutside for hide dropdown
Signed-off-by: Aurélien <dav.aurelien@gmail.com>
Diffstat (limited to 'js/controller')
-rw-r--r--js/controller/ContentController.js14
-rw-r--r--js/controller/ShareController.js6
2 files changed, 13 insertions, 7 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js
index 15459c01b..ab01bf0cd 100644
--- a/js/controller/ContentController.js
+++ b/js/controller/ContentController.js
@@ -12,6 +12,7 @@ app.controller('ContentController', function (Publisher, FeedResource, ItemResou
$filter) {
'use strict';
+ this.showDropdown = [];
var self = this;
ItemResource.clear();
@@ -222,4 +223,15 @@ app.controller('ContentController', function (Publisher, FeedResource, ItemResou
};
this.activeItem = this.getFirstItem();
-}); \ No newline at end of file
+
+ this.openDropdown = function(itemId){
+ let actualItem = this.showDropdown[itemId];
+ this.showDropdown = [];
+ this.showDropdown[itemId] = !actualItem;
+ };
+
+ this.hide = function(){
+ this.showDropdown = [];
+ };
+
+});
diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js
index 8d7235d89..eb056ce19 100644
--- a/js/controller/ShareController.js
+++ b/js/controller/ShareController.js
@@ -12,12 +12,6 @@
app.controller('ShareController', function (ShareResource, Loading) {
'use strict';
- this.showDropDown = false;
-
- this.toggleDropdown = function() {
- this.showDropDown = !this.showDropDown;
- };
-
/** Array containing users to share an item with */
this.userList = [];