mail: give postit a title bar, clicking on it open/close the postit (#11073)
This commit is contained in:
parent
dfe8e1e1ab
commit
7c34b60fc3
|
@ -32,10 +32,14 @@
|
||||||
<button data-action-url="{{reject_url}}" class="reject">Rejeter (illisible)</button>
|
<button data-action-url="{{reject_url}}" class="reject">Rejeter (illisible)</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
<div id="postit" style="display: none"
|
<div id="postit" style="display: none">
|
||||||
data-title-selector="h2"
|
<div class="hbar"></div>
|
||||||
data-base-url="{% url 'mail-edit-note' %}"
|
<div class="content"
|
||||||
data-inplace-submit="true">
|
data-title-selector="h2"
|
||||||
|
data-base-url="{% url 'mail-edit-note' %}"
|
||||||
|
data-inplace-submit="true"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<iframe id="pdf-viewer" src="{% url 'mail-viewer' %}">
|
<iframe id="pdf-viewer" src="{% url 'mail-viewer' %}">
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
|
@ -434,7 +434,6 @@ div#postit {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 4em;
|
right: 4em;
|
||||||
top: 11em;
|
top: 11em;
|
||||||
padding: 1ex;
|
|
||||||
max-width: 15em;
|
max-width: 15em;
|
||||||
background: rgba(241,231,103,1);
|
background: rgba(241,231,103,1);
|
||||||
overflow-x: none;
|
overflow-x: none;
|
||||||
|
@ -443,6 +442,23 @@ div#postit {
|
||||||
box-shadow: 3px 3px 3px #aaa;
|
box-shadow: 3px 3px 3px #aaa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div#postit > div.hbar {
|
||||||
|
height: 2ex;
|
||||||
|
background: #ff9c3b;
|
||||||
|
min-width: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#postit.closed > div.content {
|
||||||
|
max-height: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#postit > div.content {
|
||||||
|
padding: 1ex;
|
||||||
|
transition: max-height 0.5s ease;
|
||||||
|
max-height: 50ex;
|
||||||
|
}
|
||||||
|
|
||||||
form#note textarea {
|
form#note textarea {
|
||||||
width: calc(100% - 2em);
|
width: calc(100% - 2em);
|
||||||
height: 8em;
|
height: 8em;
|
||||||
|
|
|
@ -80,7 +80,7 @@ $(function() {
|
||||||
$('#id_post_date').val($(this).data('post-date'));
|
$('#id_post_date').val($(this).data('post-date'));
|
||||||
$('#id_registered_mail_number').val($(this).data('registered-mail-number'));
|
$('#id_registered_mail_number').val($(this).data('registered-mail-number'));
|
||||||
var source_pk = $('div.source .active[data-source-pk]').data('source-pk');
|
var source_pk = $('div.source .active[data-source-pk]').data('source-pk');
|
||||||
$('#postit').data('url', $('#postit').data('base-url') + '?mail=' + source_pk);
|
$('#postit > div.content').data('url', $('#postit > div.content').data('base-url') + '?mail=' + source_pk);
|
||||||
$('#postit').trigger('welco:load-mail-note');
|
$('#postit').trigger('welco:load-mail-note');
|
||||||
$('#postit').show();
|
$('#postit').show();
|
||||||
refresh_bottom_cells(function() {
|
refresh_bottom_cells(function() {
|
||||||
|
@ -359,7 +359,7 @@ $(function() {
|
||||||
$(document).on('gadjo:dialog-done welco:load-mail-note', function(ev) {
|
$(document).on('gadjo:dialog-done welco:load-mail-note', function(ev) {
|
||||||
if (ev.target && ev.target.id == 'create-new-contact') return;
|
if (ev.target && ev.target.id == 'create-new-contact') return;
|
||||||
var source_pk = $('div.source .active[data-source-pk]').data('source-pk');
|
var source_pk = $('div.source .active[data-source-pk]').data('source-pk');
|
||||||
$('#postit').load('/ajax/mail/note/' + source_pk);
|
$('#postit > div.content').load('/ajax/mail/note/' + source_pk);
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('gadjo:dialog-done welco:load-copies', function(ev) {
|
$(document).on('gadjo:dialog-done welco:load-copies', function(ev) {
|
||||||
|
@ -409,8 +409,14 @@ $(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#postit').on('click', window.displayPopup);
|
$('#postit > div.content').on('click', function() {
|
||||||
$('#postit.readonly').off('click');
|
$('#postit').removeClass('closed');
|
||||||
|
});
|
||||||
|
$('#postit > div.content').on('click', window.displayPopup);
|
||||||
|
$('#postit.readonly > div').off('click');
|
||||||
|
$('#postit > div.hbar').on('click', function() {
|
||||||
|
$('#postit').toggleClass('closed');
|
||||||
|
});
|
||||||
$('#id_post_date').datepicker($.datepicker.regional["fr"]);
|
$('#id_post_date').datepicker($.datepicker.regional["fr"]);
|
||||||
|
|
||||||
if ($('#category-filter').length) {
|
if ($('#category-filter').length) {
|
||||||
|
|
Loading…
Reference in New Issue