Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically open and copy the menu on public link share activation #11537

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions core/js/sharedialoglinkshareview.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@
throw 'missing OC.Share.ShareConfigModel';
}

var clipboard = new Clipboard('.clipboardButton');
clipboard.on('success', function(e) {
this.clipboard = new Clipboard('.clipboardButton');
this.clipboard.on('success', function(e) {
var $menu = $(e.trigger);
var $linkTextMenu = $menu.parent().next('li.linkTextMenu')

Expand All @@ -253,7 +253,7 @@
$menu.tooltip('destroy');
}, 3000);
});
clipboard.on('error', function (e) {
this.clipboard.on('error', function (e) {
var $menu = $(e.trigger);
var $linkTextMenu = $menu.parent().next('li.linkTextMenu')
var $input = $linkTextMenu.find('.linkText');
Expand Down Expand Up @@ -291,11 +291,22 @@

if($checkBox.is(':checked')) {
if(this.configModel.get('enforcePasswordForPublicLink') === false) {
var self = this;
$loading.removeClass('hidden');
// this will create it
this.model.saveLinkShare();
$('.share-menu .icon-more').click();
$('.share-menu .icon-more + .popovermenu .clipboardButton').click();
this.model.saveLinkShare().done(function(response) {
// wait for the menu to be displayed
var checkExist = setInterval(function() {
if (self.$el.find('.share-menu .icon-more').length) {
self.$el.find('.share-menu .icon-more').click();
document.querySelector('.clipboardButton').click();
clearInterval(checkExist);
}
}, 100);
setTimeout(function() {
clearInterval(checkExist);
}, 500);
})
} else {
// force the rendering of the menu
this.showPending = true;
Expand Down