summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-09-26 00:04:27 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-09-26 00:04:27 -0400
commit00103d730fe2ce57ee389fd7d219847d8cb015a3 (patch)
tree390ccfa9da919f0d04855e8ebf4fb0c4bddb5cf5
parentf967bfc9566c2b5a6ca393f1ac5e2e8b0ff1ac7e (diff)
downloadnextcloud-server-00103d730fe2ce57ee389fd7d219847d8cb015a3.tar.gz
nextcloud-server-00103d730fe2ce57ee389fd7d219847d8cb015a3.zip
Show share expiration date set for shared item
-rw-r--r--core/js/share.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/js/share.js b/core/js/share.js
index edd9142c381..e45dc7dd424 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -166,6 +166,9 @@ OC.Share={
OC.Share.addShareWith(share.share_type, share.share_with, share.permissions, possiblePermissions, false);
}
}
+ if (share.expiration.length > 0) {
+ OC.Share.showExpirationDate(share.expiration);
+ }
});
}
$('#shareWith').autocomplete({minLength: 2, source: function(search, response) {
@@ -322,6 +325,15 @@ OC.Share={
},
dirname:function(path) {
return path.replace(/\\/g,'/').replace(/\/[^\/]*$/, '');
+ },
+ showExpirationDate:function(date) {
+ $('#expirationCheckbox').attr('checked', true);
+ $('#expirationDate').before('<br />');
+ $('#expirationDate').val(date);
+ $('#expirationDate').show();
+ $('#expirationDate').datepicker({
+ dateFormat : 'dd-mm-yy'
+ });
}
}
@@ -468,11 +480,7 @@ $(document).ready(function() {
$('#expirationCheckbox').live('click', function() {
if (this.checked) {
- $('#expirationDate').before('<br />');
- $('#expirationDate').show();
- $('#expirationDate').datepicker({
- dateFormat : 'dd-mm-yy'
- });
+ OC.Share.showExpirationDate('');
} else {
$('#expirationDate').hide();
}