summaryrefslogtreecommitdiffstats
path: root/apps/files/js/fileactionsmenu.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-08-05 12:48:42 +0200
committerVincent Petry <pvince81@owncloud.com>2015-08-10 14:12:34 +0200
commit9454e9043a7b18108f14a00d6ab8afa62fb894af (patch)
tree8458931b8d187f1378baf65058679f7993943011 /apps/files/js/fileactionsmenu.js
parentdd4e0a8253d108e8b9cf9444990164d66b3d75f0 (diff)
downloadnextcloud-server-9454e9043a7b18108f14a00d6ab8afa62fb894af.tar.gz
nextcloud-server-9454e9043a7b18108f14a00d6ab8afa62fb894af.zip
Updated unit tests for file actions and actions menu
Diffstat (limited to 'apps/files/js/fileactionsmenu.js')
-rw-r--r--apps/files/js/fileactionsmenu.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/files/js/fileactionsmenu.js b/apps/files/js/fileactionsmenu.js
index dabf530b177..1795fdeab11 100644
--- a/apps/files/js/fileactionsmenu.js
+++ b/apps/files/js/fileactionsmenu.js
@@ -42,7 +42,7 @@
/**
* @private
*/
- initialize: function(fileActions, fileList) {
+ initialize: function() {
this.$el = $('<div class="fileActionsMenu dropdown hidden menu"></div>');
this._template = Handlebars.compile(TEMPLATE_MENU);
@@ -50,6 +50,10 @@
this.$el.on('afterHide', _.bind(this._onHide, this));
},
+ destroy: function() {
+ this.$el.remove();
+ },
+
/**
* Event handler whenever an action has been clicked within the menu
*
@@ -118,17 +122,15 @@
/**
* Displays the menu under the given element
*
- * @param {Object} $el target element
* @param {OCA.Files.FileActionContext} context context
*/
- showAt: function($el, context) {
+ showAt: function(context) {
this._context = context;
this.render();
this.$el.removeClass('hidden');
- $el.closest('td').append(this.$el);
-
+ context.$file.find('td.filename').append(this.$el);
context.$file.addClass('mouseOver');
OC.showMenu(null, this.$el);
@@ -139,7 +141,7 @@
*/
_onHide: function() {
this._context.$file.removeClass('mouseOver');
- this.$el.remove();
+ this.destroy();
}
};