calendar: alarm actions in tooltip

This commit is contained in:
boyska 2017-07-10 13:24:39 +02:00
parent 0778338859
commit 8c4c27d112
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9

View file

@ -19,6 +19,15 @@ $('li.alarm').click(function() {
var audio = $('<p/>').append($('<a/>').text('Modifica audio evento').attr('href', 'edit/event/' + alarmid)); var audio = $('<p/>').append($('<a/>').text('Modifica audio evento').attr('href', 'edit/event/' + alarmid));
$('<div/>').append(time).append(audio).dialog({modal: true, title: "Evento " + $(this).text()}); $('<div/>').append(time).append(audio).dialog({modal: true, title: "Evento " + $(this).text()});
}); });
$(document).tooltip({
items: "li.alarm",
content: function() {
var el = $(this);
return el.find('.alarm-actions').html();
}
});
}); });
</script> </script>
{%endblock%} {%endblock%}
@ -27,6 +36,7 @@ $('li.alarm').click(function() {
<style> <style>
.soft-highlight { background-color: rgba(230, 230, 118, 0.36); } .soft-highlight { background-color: rgba(230, 230, 118, 0.36); }
time { transition: background-color 500ms; } time { transition: background-color 500ms; }
li.alarm .alarm-actions { display: none; }
</style> </style>
{% endblock %} {% endblock %}
@ -44,7 +54,9 @@ time { transition: background-color 500ms; }
<time>{{t.time()}}</time> <time>{{t.time()}}</time>
<ul> <ul>
{% for alarm, actions in days[day][t] %} {% for alarm, actions in days[day][t] %}
<li class="alarm" data-alarmid="{{alarm.eid}}">{{alarm.nick}}</li> <li class="alarm" data-alarmid="{{alarm.eid}}">{{alarm.nick}}
<div class="alarm-actions">{% for a in actions %}{{a.nick}}{%endfor%}</div>
</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>