diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-12 14:21:14 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-16 07:23:27 +0200 |
commit | f29b51682bc0be785e1a3e4e5901db3255e4a377 (patch) | |
tree | 93375423f13d63a4ca97cc800b8fb981d48432f5 /core/js/sharedialogexpirationview.js | |
parent | 4c702aa8fdfb28bea4b021e55e7df5eeeb6999d2 (diff) | |
download | nextcloud-server-f29b51682bc0be785e1a3e4e5901db3255e4a377.tar.gz nextcloud-server-f29b51682bc0be785e1a3e4e5901db3255e4a377.zip |
share and unshare via link (not yet password). also some internal changes to reduce unnecessary rendering
Diffstat (limited to 'core/js/sharedialogexpirationview.js')
-rw-r--r-- | core/js/sharedialogexpirationview.js | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/js/sharedialogexpirationview.js b/core/js/sharedialogexpirationview.js index 56473cdb1fa..f244fe56548 100644 --- a/core/js/sharedialogexpirationview.js +++ b/core/js/sharedialogexpirationview.js @@ -24,7 +24,7 @@ '<label for="expirationCheckbox">{{setExpirationLabel}}</label>' + ' {{#if isExpirationSet}}' + '<label for="expirationDate" class="hidden-visually" value="{{expirationDate}}">{{expirationLabel}}</label>' + - '<input id="expirationDate" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" />' + + '<input id="expirationDate" class="datepicker" type="text" placeholder="{{expirationDatePlaceholder}}" value="{{expirationValue}}" />' + ' {{/if}}' + ' {{#if isExpirationEnforced}}' + // originally the expire message was shown when a default date was set, however it never had text @@ -64,13 +64,28 @@ } else { throw 'missing OC.Share.ShareConfigModel'; } + + var view = this; + this.configModel.on('change:isDefaultExpireDateEnforced', function() { + view.render(); + }); + + this.model.on('change:itemType', function() { + view.render(); + }); + + this.model.on('change:linkShare', function() { + view.render(); + }); }, render: function() { var defaultExpireMessage = ''; var defaultExpireDays = this.configModel.get('defaultExpireDate'); + var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced'); + if( (this.model.isFolder() || this.model.isFile()) - && this.configModel.get('isDefaultExpireDateEnforced')) { + && isExpirationEnforced) { defaultExpireMessage = t( 'core', 'The public link will expire no later than {days} days after it is created', @@ -79,7 +94,6 @@ } var isExpirationSet = !!this.model.get('linkShare').expiration; - var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced'); var expirationTemplate = this.template(); this.$el.html(expirationTemplate({ @@ -120,6 +134,8 @@ }); } + this.$el.find('.datepicker').datepicker({dateFormat : 'dd-mm-yy'}); + return this; }, |