summaryrefslogtreecommitdiffstats
path: root/welco/static
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2016-05-26 17:59:54 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2016-05-26 17:59:54 (GMT)
commit7c34b60fc39cbec6885a5e1d85bd8b8b27a12b85 (patch)
tree342c4a943d1e0ae6303a13f189ff1846f75b1d7c /welco/static
parentdfe8e1e1ab697b16abcb1ae8f5fc10c9fe7d8598 (diff)
downloadwelco-7c34b60fc39cbec6885a5e1d85bd8b8b27a12b85.zip
welco-7c34b60fc39cbec6885a5e1d85bd8b8b27a12b85.tar.gz
welco-7c34b60fc39cbec6885a5e1d85bd8b8b27a12b85.tar.bz2
mail: give postit a title bar, clicking on it open/close the postit (#11073)
Diffstat (limited to 'welco/static')
-rw-r--r--welco/static/css/style.css18
-rw-r--r--welco/static/js/welco.js14
2 files changed, 27 insertions, 5 deletions
diff --git a/welco/static/css/style.css b/welco/static/css/style.css
index 1a8c170..6b5bff7 100644
--- a/welco/static/css/style.css
+++ b/welco/static/css/style.css
@@ -434,7 +434,6 @@ div#postit {
position: absolute;
right: 4em;
top: 11em;
- padding: 1ex;
max-width: 15em;
background: rgba(241,231,103,1);
overflow-x: none;
@@ -443,6 +442,23 @@ div#postit {
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 {
width: calc(100% - 2em);
height: 8em;
diff --git a/welco/static/js/welco.js b/welco/static/js/welco.js
index 89b05f6..de70454 100644
--- a/welco/static/js/welco.js
+++ b/welco/static/js/welco.js
@@ -80,7 +80,7 @@ $(function() {
$('#id_post_date').val($(this).data('post-date'));
$('#id_registered_mail_number').val($(this).data('registered-mail-number'));
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').show();
refresh_bottom_cells(function() {
@@ -359,7 +359,7 @@ $(function() {
$(document).on('gadjo:dialog-done welco:load-mail-note', function(ev) {
if (ev.target && ev.target.id == 'create-new-contact') return;
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) {
@@ -409,8 +409,14 @@ $(function() {
});
- $('#postit').on('click', window.displayPopup);
- $('#postit.readonly').off('click');
+ $('#postit > div.content').on('click', function() {
+ $('#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"]);
if ($('#category-filter').length) {