diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-05 10:54:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-05 10:54:32 +0100 |
commit | 05bcdf937b9976de560192a3b06c21e5b6ea7774 (patch) | |
tree | f158fe5526fdd7a05ca888f642b1f02d79abeffb /core/js | |
parent | ad8e9b2f5f8c524ff0e4d6c934935249f642b664 (diff) | |
parent | 6127d19f546904e97ed67696f9bc2fdfd5c8d575 (diff) | |
download | nextcloud-server-05bcdf937b9976de560192a3b06c21e5b6ea7774.tar.gz nextcloud-server-05bcdf937b9976de560192a3b06c21e5b6ea7774.zip |
Merge pull request #7477 from nextcloud/date-time-picker-position-fix
Date time picker position fix & design fixes
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/sharedialogshareelistview.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index b4828e3b0dc..30cbeff3c64 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -116,7 +116,7 @@ '<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="{{expireDate}}" />' + + ' <input id="expirationDatePicker-{{cid}}-{{shareId}}" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{#if hasExpireDate}}{{expireDate}}{{else}}{{defaultExpireDate}}{{/if}}" />' + '</div>' + '</span>' + '</li>' + @@ -266,6 +266,8 @@ expireDateLabel: t('core', 'Set expiration date'), passwordLabel: t('core', 'Password protect'), crudsLabel: t('core', 'Access control'), + expirationDatePlaceholder: t('core', 'Expiration date'), + defaultExpireDate: moment().add(1, 'day').format('DD-MM-YYYY'), // Can't expire today triangleSImage: OC.imagePath('core', 'actions/triangle-s'), isResharingAllowed: this.configModel.get('isResharingAllowed'), isPasswordForMailSharesRequired: this.configModel.get('isPasswordForMailSharesRequired'), @@ -513,19 +515,14 @@ var shareId = li.data('share-id'); var expirationDatePicker = '#expirationDatePicker-' + this.cid + '-' + shareId; var view = this; - $(expirationDatePicker).closest('div').datepicker({ + $(expirationDatePicker).datepicker({ dateFormat : 'dd-mm-yy', - onSelect: - function (expireDate) { - view.setExpirationDate(shareId, expireDate); - }, - onClose: - function () { - $(expirationDatePicker).removeClass('hidden-visually'); - } + onSelect: function (expireDate) { + view.setExpirationDate(shareId, expireDate); + } }); + $(expirationDatePicker).focus(); - $(expirationDatePicker).addClass('hidden-visually'); }, setExpirationDate: function(shareId, expireDate) { |