summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialogshareelistview.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-19 20:05:37 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-21 15:02:20 +0200
commit3a11c26cb49c7d5de3410075d86e165a8452a761 (patch)
treea68380f696ab61cfc362181e1d329b363651eb03 /core/js/sharedialogshareelistview.js
parentc71d3dc9bf22a19745d5da40b261605fc337f44c (diff)
downloadnextcloud-server-3a11c26cb49c7d5de3410075d86e165a8452a761.tar.gz
nextcloud-server-3a11c26cb49c7d5de3410075d86e165a8452a761.zip
Public fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/js/sharedialogshareelistview.js')
-rw-r--r--core/js/sharedialogshareelistview.js37
1 files changed, 23 insertions, 14 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js
index cdf6972a940..a9704155394 100644
--- a/core/js/sharedialogshareelistview.js
+++ b/core/js/sharedialogshareelistview.js
@@ -103,11 +103,13 @@
'<span class="shareOption menuitem">' +
'<input id="password-{{cid}}-{{shareId}}" type="checkbox" name="password" class="password checkbox" {{#if isPasswordSet}}checked="checked"{{/if}}{{#if isPasswordSet}}{{#if isPasswordForMailSharesRequired}}disabled=""{{/if}}{{/if}}" />' +
'<label for="password-{{cid}}-{{shareId}}">{{passwordLabel}}</label>' +
- '<div class="passwordContainer-{{cid}}-{{shareId}} {{#unless isPasswordSet}}hidden{{/unless}}">' +
- ' <label for="passwordField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordLabel}}</label>' +
- ' <input id="passwordField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />' +
- ' <span class="icon-loading-small hidden"></span>' +
- '</div>' +
+ '</span>' +
+ '</li>' +
+ '<li class="passwordMenu-{{cid}}-{{shareId}} {{#unless isPasswordSet}}hidden{{/unless}}">' +
+ '<span class="passwordContainer-{{cid}}-{{shareId}} icon-passwordmail menuitem">' +
+ ' <label for="passwordField-{{cid}}-{{shareId}}" class="hidden-visually" value="{{password}}">{{passwordLabel}}</label>' +
+ ' <input id="passwordField-{{cid}}-{{shareId}}" class="passwordField" type="password" placeholder="{{passwordPlaceholder}}" value="{{passwordValue}}" autocomplete="new-password" />' +
+ ' <span class="icon-loading-small hidden"></span>' +
'</span>' +
'</li>' +
'{{/if}}' +
@@ -115,10 +117,12 @@
'<span class="shareOption menuitem">' +
'<input id="expireDate-{{cid}}-{{shareId}}" type="checkbox" name="expirationDate" class="expireDate checkbox" {{#if hasExpireDate}}checked="checked"{{/if}}" />' +
'<label for="expireDate-{{cid}}-{{shareId}}">{{expireDateLabel}}</label>' +
- '<div class="expirationDateContainer-{{cid}}-{{shareId}} {{#unless hasExpireDate}}hidden{{/unless}}">' +
- ' <label for="expirationDatePicker-{{cid}}-{{shareId}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>' +
- ' <input id="expirationDatePicker-{{cid}}-{{shareId}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />' +
- '</div>' +
+ '</span>' +
+ '</li>' +
+ '<li class="expirationDateMenu-{{cid}}-{{shareId}} {{#unless hasExpireDate}}hidden{{/unless}}">' +
+ '<span class="expirationDateContainer-{{cid}}-{{shareId}} icon-expiredate menuitem">' +
+ ' <label for="expirationDatePicker-{{cid}}-{{shareId}}" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>' +
+ ' <input id="expirationDatePicker-{{cid}}-{{shareId}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />' +
'</span>' +
'</li>' +
'<li>' +
@@ -496,13 +500,13 @@
event.preventDefault();
event.stopPropagation();
var $element = $(event.target);
- var $li = $element.closest('li[data-share-id]');
var $menu = $element.closest('li');
var $form = $menu.next('li.share-note-form');
// show elements
$menu.find('.share-note-delete').toggle();
$form.toggleClass('hidden');
+ $form.find('textarea').focus();
},
deleteNote(event) {
@@ -617,16 +621,21 @@
},
onExpireDateChange: function(event) {
- var element = $(event.target);
- var li = element.closest('li[data-share-id]');
+ var $element = $(event.target);
+ var li = $element.closest('li[data-share-id]');
var shareId = li.data('share-id');
var datePickerClass = '.expirationDateContainer-' + this.cid + '-' + shareId;
var datePicker = $(datePickerClass);
- var state = element.prop('checked');
+ var state = $element.prop('checked');
datePicker.toggleClass('hidden', !state);
if (!state) {
+ // disabled, let's hide the input and
+ // set the expireDate to nothing
+ $element.closest('li').next('li').addClass('hidden');
this.setExpirationDate(shareId, '');
} else {
+ // enabled, show the input and the datepicker
+ $element.closest('li').next('li').removeClass('hidden');
this.showDatePicker(event);
}
@@ -656,7 +665,7 @@
var element = $(event.target);
var li = element.closest('li[data-share-id]');
var shareId = li.data('share-id');
- var passwordContainerClass = '.passwordContainer-' + this.cid + '-' + shareId;
+ var passwordContainerClass = '.passwordMenu-' + this.cid + '-' + shareId;
var passwordContainer = $(passwordContainerClass);
var loading = this.$el.find(passwordContainerClass + ' .icon-loading-small');
var inputClass = '#passwordField-' + this.cid + '-' + shareId;