mirror of https://github.com/zulip/zulip.git
ui: Render feedback widget client side.
We re-render the feedback widget on every call to show(). This allows us more flexibility to mess with the markup for particular use cases.
This commit is contained in:
parent
c3a0a22661
commit
d844a070fd
|
@ -93,11 +93,11 @@ function set_up_handlers() {
|
|||
meta.hide_me_time = Math.max(meta.hide_me_time, new Date().getTime() + 2000);
|
||||
});
|
||||
|
||||
meta.$container.find('.exit-me').click(function () {
|
||||
meta.$container.on('click', '.exit-me', function () {
|
||||
animate.fadeOut();
|
||||
});
|
||||
|
||||
meta.$container.find(".feedback_undo").click(function () {
|
||||
meta.$container.on('click', '.feedback_undo', function () {
|
||||
if (meta.undo) {
|
||||
meta.undo();
|
||||
}
|
||||
|
@ -121,6 +121,9 @@ exports.show = function (opts) {
|
|||
|
||||
meta.$container = $('#feedback_container');
|
||||
|
||||
var html = templates.render('feedback_container');
|
||||
meta.$container.html(html);
|
||||
|
||||
set_up_handlers();
|
||||
|
||||
meta.undo = opts.on_undo;
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<div class="float-header">
|
||||
<h3 class="light no-margin small-line-height float-left feedback_title"></h3>
|
||||
<div class="exit-me float-right">×</div>
|
||||
<button class="button small rounded float-right feedback_undo" type="button" name="button"></button>
|
||||
<div class="float-clear"></div>
|
||||
</div>
|
||||
<p class="n-margin feedback_content"></p>
|
|
@ -1,9 +0,0 @@
|
|||
<div id="feedback_container" class="new-style">
|
||||
<div class="float-header">
|
||||
<h3 class="light no-margin small-line-height float-left feedback_title"></h3>
|
||||
<div class="exit-me float-right">×</div>
|
||||
<button class="button small rounded float-right feedback_undo" type="button" name="button"></button>
|
||||
<div class="float-clear"></div>
|
||||
</div>
|
||||
<p class="n-margin feedback_content"></p>
|
||||
</div>
|
|
@ -35,7 +35,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include "zerver/app/feedback_widget.html" %}
|
||||
<div id="feedback_container" class="new-style">
|
||||
</div>
|
||||
|
||||
<div id="css-loading">
|
||||
<h3>{{ _('Loading...') }}</h3>
|
||||
|
|
Loading…
Reference in New Issue