From 7533fcb977f6153065ad99b9c9e046c4e744f84e Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 28 Jul 2016 10:46:00 +0200 Subject: move unshare button out of popover menu; keep menu opened on re-render --- core/css/share.css | 1 - core/js/sharedialogshareelistview.js | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'core') diff --git a/core/css/share.css b/core/css/share.css index 0da3aa5359d..7d11cbff381 100644 --- a/core/css/share.css +++ b/core/css/share.css @@ -105,7 +105,6 @@ a.showCruds { a.unshare { display:inline; - float:right; opacity:.5; padding: 10px; margin-top: -5px; diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index 04cd64603d9..7caefcca30d 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -75,14 +75,9 @@ '' + '{{/if}}' + '{{/if}}' + - '
  • ' + - '' + - '' + - '{{unshareLabel}}' + - '' + - '
  • ' + '' + '' + + '{{unshareLabel}}' + '' + '' + '{{/each}}' + @@ -108,6 +103,8 @@ /** @type {Function} **/ _template: undefined, + _menuOpen: false, + events: { 'click .unshare': 'onUnshare', 'click .icon-more': 'onToggleMenu', @@ -210,7 +207,7 @@ })); if(this.configModel.areAvatarsEnabled()) { - this.$el.find('.avatar').each(function() { + this.$('.avatar').each(function() { var $this = $(this); if ($this.hasClass('imageplaceholderseed')) { $this.css({width: 32, height: 32}); @@ -221,10 +218,19 @@ }); } - this.$el.find('.has-tooltip').tooltip({ + this.$('.has-tooltip').tooltip({ placement: 'bottom' }); + var _this = this; + this.$('.popovermenu').on('afterHide', function() { + _this._menuOpen = false; + }); + if (this._menuOpen) { + // Open menu again if it was opened before + OC.showMenu(null, this.$('.popovermenu')); + } + this.delegateEvents(); return this; @@ -280,6 +286,7 @@ var $menu = $li.find('.popovermenu'); OC.showMenu(null, $menu); + this._menuOpen = true; }, onPermissionChange: function(event) { -- cgit v1.2.3