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

Only show link share menu if needed #14280

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/js/dist/share_backend.js.map

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions core/js/sharedialoglinkshareview.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
// hide download
'change .hideDownloadCheckbox': 'onHideDownloadChange',
// password
'click input.share-pass-submit': 'onPasswordEntered',
'click input.share-pass-submit': 'onPasswordEntered',
'keyup input.linkPassText': 'onPasswordKeyUp', // check for the enter key
'change .showPasswordCheckbox': 'onShowPasswordClick',
'change .passwordByTalkCheckbox': 'onPasswordByTalkChange',
Expand Down Expand Up @@ -110,7 +110,7 @@
// changes; other changes in the link shares does not trigger
// a rendering, so the view must be rendered again as needed in
// those cases (for example, when a link share is removed).

var previousLinkShares = model.previous('linkShares');
if (previousLinkShares.length !== linkShares.length) {
return;
Expand Down Expand Up @@ -211,6 +211,8 @@

var isPasswordEnforced = this.configModel.get('enforcePasswordForPublicLink');
var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');
var isPasswordEnabledByDefault = this.configModel.get('enableLinkPasswordByDefault') === true;


// set default expire date
if (isExpirationEnforced) {
Expand Down Expand Up @@ -240,7 +242,7 @@
self.render();
// open the menu by default
// we can only do that after the render
if (newShareId) {
if (newShareId && isPasswordEnabledByDefault) {
var shares = self.$el.find('li[data-share-id]');
var $newShare = self.$el.find('li[data-share-id="'+newShareId+'"]');
// only open the menu by default if this is the first share
Expand Down