Fix note display

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-10-31 10:49:06 +01:00 committed by Daniel Calviño Sánchez
parent 106ed07d6a
commit 206d6126b6
6 changed files with 28 additions and 16 deletions

View File

@ -75,13 +75,15 @@
} }
.share-add { .share-add {
input.share-note-delete { input.share-note-delete {
display: none;
border: none; border: none;
background-color: transparent; background-color: transparent;
width: 44px !important; width: 44px !important;
padding: 0; padding: 0;
flex: 0 0 44px; flex: 0 0 44px;
margin-left: auto; margin-left: auto;
&.hidden {
display: none;
}
} }
} }
// note // note

View File

@ -87,14 +87,14 @@
<span class="icon-loading-small hidden"></span> <span class="icon-loading-small hidden"></span>
<span class="icon icon-edit"></span> <span class="icon icon-edit"></span>
<span>{{addNoteLabel}}</span> <span>{{addNoteLabel}}</span>
<input type="button" class="share-note-delete icon-delete"> <input type="button" class="share-note-delete icon-delete {{#unless hasNote}}hidden{{/unless}}">
</a> </a>
</li> </li>
<li class="share-note-form share-note-link {{#unless hasNote}}hidden{{/unless}}"> <li class="share-note-form share-note-link {{#unless hasNote}}hidden{{/unless}}">
<span class="menuitem icon-note"> <span class="menuitem icon-note">
<textarea class="share-note">{{shareNote}}</textarea> <textarea class="share-note">{{shareNote}}</textarea>
<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" /> <input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />
</span> </span>
</li> </li>
{{#each social}} {{#each social}}
<li> <li>

View File

@ -86,13 +86,14 @@
</li> </li>
{{#if isNoteAvailable}} {{#if isNoteAvailable}}
<li> <li>
<a href="#" class="share-add"><span class="icon-loading-small hidden"></span> <a href="#" class="share-add">
<span class="icon-loading-small hidden"></span>
<span class="icon icon-edit"></span> <span class="icon icon-edit"></span>
<span>{{addNoteLabel}}</span> <span>{{addNoteLabel}}</span>
<input type="button" class="share-note-delete icon-delete"> <input type="button" class="share-note-delete icon-delete {{#unless hasNote}}hidden{{/unless}}">
</a> </a>
</li> </li>
<li class="share-note-form hidden"> <li class="share-note-form {{#unless hasNote}}hidden{{/unless}}">
<span class="menuitem icon-note"> <span class="menuitem icon-note">
<textarea class="share-note">{{shareNote}}</textarea> <textarea class="share-note">{{shareNote}}</textarea>
<input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" /> <input type="submit" class="icon-confirm share-note-submit" value="" id="add-note-{{shareId}}" />

View File

@ -329,7 +329,7 @@
var $form = $menu.next('li.share-note-form'); var $form = $menu.next('li.share-note-form');
// show elements // show elements
$menu.find('.share-note-delete').toggle(); $menu.find('.share-note-delete').toggleClass('hidden');
$form.toggleClass('hidden'); $form.toggleClass('hidden');
$form.find('textarea').focus(); $form.find('textarea').focus();
}, },
@ -347,7 +347,7 @@
$form.find('.share-note').val(''); $form.find('.share-note').val('');
$form.addClass('hidden'); $form.addClass('hidden');
$menu.find('.share-note-delete').hide(); $menu.find('.share-note-delete').addClass('hidden');
self.sendNote('', shareId, $menu); self.sendNote('', shareId, $menu);
}, },

View File

@ -134,6 +134,8 @@
var hasPassword = password !== null && password !== ''; var hasPassword = password !== null && password !== '';
var sendPasswordByTalk = share.send_password_by_talk; var sendPasswordByTalk = share.send_password_by_talk;
var shareNote = this.model.getNote(shareIndex);
return _.extend(hasPermissionOverride, { return _.extend(hasPermissionOverride, {
cid: this.cid, cid: this.cid,
hasSharePermission: this.model.hasSharePermission(shareIndex), hasSharePermission: this.model.hasSharePermission(shareIndex),
@ -159,7 +161,8 @@
isTalkEnabled: oc_appswebroots['spreed'] !== undefined, isTalkEnabled: oc_appswebroots['spreed'] !== undefined,
secureDropMode: !this.model.hasReadPermission(shareIndex), secureDropMode: !this.model.hasReadPermission(shareIndex),
hasExpireDate: this.model.getExpireDate(shareIndex) !== null, hasExpireDate: this.model.getExpireDate(shareIndex) !== null,
shareNote: this.model.getNote(shareIndex), shareNote: shareNote,
hasNote: shareNote !== '',
expireDate: moment(this.model.getExpireDate(shareIndex), 'YYYY-MM-DD').format('DD-MM-YYYY'), expireDate: moment(this.model.getExpireDate(shareIndex), 'YYYY-MM-DD').format('DD-MM-YYYY'),
// The password placeholder does not take into account if // The password placeholder does not take into account if
// sending the password by Talk is enabled or not; when // sending the password by Talk is enabled or not; when
@ -384,7 +387,7 @@
var $form = $menu.next('li.share-note-form'); var $form = $menu.next('li.share-note-form');
// show elements // show elements
$menu.find('.share-note-delete').toggle(); $menu.find('.share-note-delete').toggleClass('hidden');
$form.toggleClass('hidden'); $form.toggleClass('hidden');
$form.find('textarea').focus(); $form.find('textarea').focus();
}, },
@ -403,7 +406,7 @@
$form.find('.share-note').val(''); $form.find('.share-note').val('');
$form.addClass('hidden'); $form.addClass('hidden');
$menu.find('.share-note-delete').hide(); $menu.find('.share-note-delete').addClass('hidden');
self.sendNote('', shareId, $menu); self.sendNote('', shareId, $menu);
}, },

View File

@ -209,13 +209,15 @@ templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(cont
+ alias4(((helper = (helper = helpers.maxDate || (depth0 != null ? depth0.maxDate : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"maxDate","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.maxDate || (depth0 != null ? depth0.maxDate : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"maxDate","hash":{},"data":data}) : helper)))
+ "\" />\n </span>\n </li>\n <li>\n <a href=\"#\" class=\"share-add\">\n <span class=\"icon-loading-small hidden\"></span>\n <span class=\"icon icon-edit\"></span>\n <span>" + "\" />\n </span>\n </li>\n <li>\n <a href=\"#\" class=\"share-add\">\n <span class=\"icon-loading-small hidden\"></span>\n <span class=\"icon icon-edit\"></span>\n <span>"
+ alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+ "</span>\n <input type=\"button\" class=\"share-note-delete icon-delete\">\n </a>\n </li>\n <li class=\"share-note-form share-note-link " + "</span>\n <input type=\"button\" class=\"share-note-delete icon-delete "
+ ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasNote : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\">\n </a>\n </li>\n <li class=\"share-note-form share-note-link "
+ ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasNote : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasNote : depth0),{"name":"unless","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\">\n <span class=\"menuitem icon-note\">\n <textarea class=\"share-note\">" + "\">\n <span class=\"menuitem icon-note\">\n <textarea class=\"share-note\">"
+ alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper)))
+ "</textarea>\n <input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-" + "</textarea>\n <input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-"
+ alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))
+ "\" />\n </span>\n </li>\n" + "\" />\n </span>\n </li>\n"
+ ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " <li>\n <a href=\"#\" class=\"unshare\"><span class=\"icon-loading-small hidden\"></span><span class=\"icon icon-delete\"></span><span>" + " <li>\n <a href=\"#\" class=\"unshare\"><span class=\"icon-loading-small hidden\"></span><span class=\"icon icon-delete\"></span><span>"
+ alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper)))
@ -565,11 +567,15 @@ templates['sharedialogshareelistview_popover_menu'] = template({"1":function(con
return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper))); return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
},"30":function(container,depth0,helpers,partials,data) { },"30":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression; var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <li>\n <a href=\"#\" class=\"share-add\"><span class=\"icon-loading-small hidden\"></span>\n <span class=\"icon icon-edit\"></span>\n <span>" return " <li>\n <a href=\"#\" class=\"share-add\">\n <span class=\"icon-loading-small hidden\"></span>\n <span class=\"icon icon-edit\"></span>\n <span>"
+ alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+ "</span>\n <input type=\"button\" class=\"share-note-delete icon-delete\">\n </a>\n </li>\n <li class=\"share-note-form hidden\">\n <span class=\"menuitem icon-note\">\n <textarea class=\"share-note\">" + "</span>\n <input type=\"button\" class=\"share-note-delete icon-delete "
+ ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasNote : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\">\n </a>\n </li>\n <li class=\"share-note-form "
+ ((stack1 = helpers.unless.call(alias1,(depth0 != null ? depth0.hasNote : depth0),{"name":"unless","hash":{},"fn":container.program(22, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\">\n <span class=\"menuitem icon-note\">\n <textarea class=\"share-note\">"
+ alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.shareNote || (depth0 != null ? depth0.shareNote : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareNote","hash":{},"data":data}) : helper)))
+ "</textarea>\n <input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-" + "</textarea>\n <input type=\"submit\" class=\"icon-confirm share-note-submit\" value=\"\" id=\"add-note-"
+ alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper))) + alias4(((helper = (helper = helpers.shareId || (depth0 != null ? depth0.shareId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shareId","hash":{},"data":data}) : helper)))