2017-03-05 17:28:40 +01:00
|
|
|
var stream_popover = (function () {
|
|
|
|
|
|
|
|
var exports = {};
|
|
|
|
|
|
|
|
// We handle stream popovers and topic popovers in this
|
|
|
|
// module. Both are popped up from the left sidebar.
|
|
|
|
var current_stream_sidebar_elem;
|
|
|
|
var current_topic_sidebar_elem;
|
2018-02-15 20:38:06 +01:00
|
|
|
var all_messages_sidebar_elem;
|
2019-02-22 12:28:29 +01:00
|
|
|
var starred_messages_sidebar_elem;
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
exports.stream_popped = function () {
|
|
|
|
return current_stream_sidebar_elem !== undefined;
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.topic_popped = function () {
|
|
|
|
return current_topic_sidebar_elem !== undefined;
|
|
|
|
};
|
|
|
|
|
2018-02-15 20:38:06 +01:00
|
|
|
exports.all_messages_popped = function () {
|
|
|
|
return all_messages_sidebar_elem !== undefined;
|
|
|
|
};
|
|
|
|
|
2019-02-22 12:28:29 +01:00
|
|
|
exports.starred_messages_popped = function () {
|
|
|
|
return starred_messages_sidebar_elem !== undefined;
|
|
|
|
};
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
exports.hide_stream_popover = function () {
|
|
|
|
if (exports.stream_popped()) {
|
|
|
|
$(current_stream_sidebar_elem).popover("destroy");
|
|
|
|
current_stream_sidebar_elem = undefined;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.hide_topic_popover = function () {
|
|
|
|
if (exports.topic_popped()) {
|
|
|
|
$(current_topic_sidebar_elem).popover("destroy");
|
|
|
|
current_topic_sidebar_elem = undefined;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-02-15 20:38:06 +01:00
|
|
|
exports.hide_all_messages_popover = function () {
|
|
|
|
if (exports.all_messages_popped()) {
|
|
|
|
$(all_messages_sidebar_elem).popover("destroy");
|
|
|
|
all_messages_sidebar_elem = undefined;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-22 12:28:29 +01:00
|
|
|
exports.hide_starred_messages_popover = function () {
|
|
|
|
if (exports.starred_messages_popped()) {
|
|
|
|
$(starred_messages_sidebar_elem).popover("destroy");
|
|
|
|
starred_messages_sidebar_elem = undefined;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
// These are the only two functions that is really shared by the
|
|
|
|
// two popovers, so we could split out topic stuff to
|
|
|
|
// another module pretty easily.
|
2017-03-08 23:39:39 +01:00
|
|
|
exports.show_streamlist_sidebar = function () {
|
2017-03-05 17:28:40 +01:00
|
|
|
$(".app-main .column-left").addClass("expanded");
|
|
|
|
resize.resize_page_components();
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.restore_stream_list_size = function () {
|
|
|
|
$(".app-main .column-left").removeClass("expanded");
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function stream_popover_sub(e) {
|
2017-08-17 01:40:28 +02:00
|
|
|
var stream_id = $(e.currentTarget).parents('ul').attr('data-stream-id');
|
|
|
|
var sub = stream_data.get_sub_by_id(stream_id);
|
2017-03-05 17:28:40 +01:00
|
|
|
if (!sub) {
|
2017-08-17 01:40:28 +02:00
|
|
|
blueslip.error('Unknown stream: ' + stream_id);
|
2017-03-05 17:28:40 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
return sub;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This little function is a workaround for the fact that
|
|
|
|
// Bootstrap popovers don't properly handle being resized --
|
|
|
|
// so after resizing our popover to add in the spectrum color
|
|
|
|
// picker, we need to adjust its height accordingly.
|
|
|
|
function update_spectrum(popover, update_func) {
|
|
|
|
var initial_height = popover[0].offsetHeight;
|
|
|
|
|
|
|
|
var colorpicker = popover.find('.colorpicker-container').find('.colorpicker');
|
|
|
|
update_func(colorpicker);
|
|
|
|
var after_height = popover[0].offsetHeight;
|
|
|
|
|
|
|
|
var popover_root = popover.closest(".popover");
|
|
|
|
var current_top_px = parseFloat(popover_root.css('top').replace('px', ''));
|
2019-02-15 01:43:17 +01:00
|
|
|
var height_delta = after_height - initial_height;
|
|
|
|
var top = current_top_px - height_delta / 2;
|
|
|
|
|
|
|
|
if (top < 0) {
|
|
|
|
top = 0;
|
|
|
|
popover_root.find("div.arrow").hide();
|
|
|
|
} else if (top + after_height > $(window).height() - 20) {
|
|
|
|
top = $(window).height() - after_height - 20;
|
|
|
|
if (top < 0) {
|
|
|
|
top = 0;
|
|
|
|
}
|
|
|
|
popover_root.find("div.arrow").hide();
|
|
|
|
}
|
2017-03-05 17:28:40 +01:00
|
|
|
|
2019-02-15 01:43:17 +01:00
|
|
|
popover_root.css('top', top + "px");
|
2017-03-05 17:28:40 +01:00
|
|
|
}
|
|
|
|
|
2019-02-22 17:07:49 +01:00
|
|
|
function build_stream_popover(opts) {
|
|
|
|
var elt = opts.elt;
|
|
|
|
var stream_id = opts.stream_id;
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
if (exports.stream_popped()
|
|
|
|
&& current_stream_sidebar_elem === elt) {
|
|
|
|
// If the popover is already shown, clicking again should toggle it.
|
|
|
|
exports.hide_stream_popover();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
popovers.hide_all();
|
2017-03-08 23:39:39 +01:00
|
|
|
exports.show_streamlist_sidebar();
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
var content = templates.render(
|
|
|
|
'stream_sidebar_actions',
|
2017-08-17 01:41:40 +02:00
|
|
|
{stream: stream_data.get_sub_by_id(stream_id)}
|
2017-03-05 17:28:40 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
$(elt).popover({
|
|
|
|
content: content,
|
|
|
|
trigger: "manual",
|
|
|
|
fixed: true,
|
2019-02-15 01:43:17 +01:00
|
|
|
fix_positions: true,
|
2017-03-05 17:28:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$(elt).popover("show");
|
2017-08-17 01:41:40 +02:00
|
|
|
var popover = $('.streams_popover[data-stream-id=' + stream_id + ']');
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
update_spectrum(popover, function (colorpicker) {
|
|
|
|
colorpicker.spectrum(stream_color.sidebar_popover_colorpicker_options);
|
|
|
|
});
|
|
|
|
|
|
|
|
current_stream_sidebar_elem = elt;
|
|
|
|
}
|
|
|
|
|
2019-02-05 14:48:39 +01:00
|
|
|
function build_topic_popover(opts) {
|
|
|
|
var elt = opts.elt;
|
|
|
|
var stream_id = opts.stream_id;
|
|
|
|
var topic_name = opts.topic_name;
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
if (exports.topic_popped()
|
|
|
|
&& current_topic_sidebar_elem === elt) {
|
|
|
|
// If the popover is already shown, clicking again should toggle it.
|
2017-03-09 08:25:22 +01:00
|
|
|
exports.hide_topic_popover();
|
2017-03-05 17:28:40 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-08-17 01:42:07 +02:00
|
|
|
var sub = stream_data.get_sub_by_id(stream_id);
|
2017-03-05 19:36:36 +01:00
|
|
|
if (!sub) {
|
2017-08-17 01:42:07 +02:00
|
|
|
blueslip.error('cannot build topic popover for stream: ' + stream_id);
|
2017-03-05 19:36:36 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
popovers.hide_all();
|
2017-03-08 23:39:39 +01:00
|
|
|
exports.show_streamlist_sidebar();
|
2017-03-05 19:36:36 +01:00
|
|
|
|
2018-12-13 22:26:10 +01:00
|
|
|
var is_muted = muting.is_topic_muted(sub.stream_id, topic_name);
|
2017-03-05 17:28:40 +01:00
|
|
|
var can_mute_topic = !is_muted;
|
|
|
|
var can_unmute_topic = is_muted;
|
|
|
|
|
|
|
|
var content = templates.render('topic_sidebar_actions', {
|
2017-08-17 01:42:07 +02:00
|
|
|
stream_name: sub.name,
|
2017-03-05 19:36:36 +01:00
|
|
|
stream_id: sub.stream_id,
|
2017-03-05 17:28:40 +01:00
|
|
|
topic_name: topic_name,
|
|
|
|
can_mute_topic: can_mute_topic,
|
|
|
|
can_unmute_topic: can_unmute_topic,
|
2019-01-18 17:40:54 +01:00
|
|
|
is_admin: sub.is_admin,
|
2017-03-05 17:28:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$(elt).popover({
|
|
|
|
content: content,
|
|
|
|
trigger: "manual",
|
|
|
|
fixed: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
$(elt).popover("show");
|
|
|
|
|
|
|
|
current_topic_sidebar_elem = elt;
|
|
|
|
}
|
|
|
|
|
2018-02-15 20:38:06 +01:00
|
|
|
function build_all_messages_popover(e) {
|
|
|
|
var elt = e.target;
|
|
|
|
|
|
|
|
if (exports.all_messages_popped()
|
|
|
|
&& all_messages_sidebar_elem === elt) {
|
|
|
|
exports.hide_all_messages_popover();
|
|
|
|
e.stopPropagation();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
popovers.hide_all();
|
|
|
|
|
|
|
|
var content = templates.render(
|
|
|
|
'all_messages_sidebar_actions'
|
|
|
|
);
|
|
|
|
|
|
|
|
$(elt).popover({
|
|
|
|
content: content,
|
|
|
|
trigger: "manual",
|
|
|
|
fixed: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
$(elt).popover("show");
|
|
|
|
all_messages_sidebar_elem = elt;
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-02-22 12:28:29 +01:00
|
|
|
function build_starred_messages_popover(e) {
|
|
|
|
var elt = e.target;
|
|
|
|
|
|
|
|
if (exports.starred_messages_popped()
|
|
|
|
&& starred_messages_sidebar_elem === elt) {
|
|
|
|
exports.hide_starred_messages_popover();
|
|
|
|
e.stopPropagation();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
popovers.hide_all();
|
|
|
|
|
|
|
|
var content = templates.render(
|
|
|
|
'starred_messages_sidebar_actions'
|
|
|
|
);
|
|
|
|
|
|
|
|
$(elt).popover({
|
|
|
|
content: content,
|
|
|
|
trigger: "manual",
|
|
|
|
fixed: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
$(elt).popover("show");
|
|
|
|
starred_messages_sidebar_elem = elt;
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
exports.register_click_handlers = function () {
|
2019-02-22 17:07:49 +01:00
|
|
|
$('#stream_filters').on('click', '.stream-sidebar-arrow', function (e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
var elt = e.target;
|
|
|
|
var stream_id = $(elt).parents('li').attr('data-stream-id');
|
|
|
|
|
|
|
|
build_stream_popover({
|
|
|
|
elt: elt,
|
|
|
|
stream_id: stream_id,
|
|
|
|
});
|
|
|
|
});
|
2019-02-05 14:48:39 +01:00
|
|
|
|
|
|
|
$('#stream_filters').on('click', '.topic-sidebar-arrow', function (e) {
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
var elt = $(e.target).closest('.topic-sidebar-arrow').expectOne()[0];
|
|
|
|
var stream_id = $(elt).closest('.narrow-filter').expectOne().attr('data-stream-id');
|
|
|
|
var topic_name = $(elt).closest('li').expectOne().attr('data-topic-name');
|
|
|
|
|
|
|
|
build_topic_popover({
|
|
|
|
elt: elt,
|
|
|
|
stream_id: stream_id,
|
|
|
|
topic_name: topic_name,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-03-01 21:06:53 +01:00
|
|
|
$('#global_filters').on('click', '.all-messages-arrow', build_all_messages_popover);
|
2018-02-15 20:38:06 +01:00
|
|
|
|
2019-02-22 12:28:29 +01:00
|
|
|
$('#global_filters').on('click', '.starred-messages-sidebar-arrow', build_starred_messages_popover);
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
exports.register_stream_handlers();
|
|
|
|
exports.register_topic_handlers();
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.register_stream_handlers = function () {
|
|
|
|
// Stream settings
|
|
|
|
$('body').on('click', '.open_stream_settings', function (e) {
|
|
|
|
var sub = stream_popover_sub(e);
|
|
|
|
exports.hide_stream_popover();
|
|
|
|
|
2018-12-02 19:59:59 +01:00
|
|
|
var stream_edit_hash = hash_util.stream_edit_uri(sub);
|
|
|
|
hashchange.go_to_location(stream_edit_hash);
|
2017-03-05 17:28:40 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
// Pin/unpin
|
|
|
|
$('body').on('click', '.pin_to_top', function (e) {
|
|
|
|
var sub = stream_popover_sub(e);
|
|
|
|
exports.hide_stream_popover();
|
|
|
|
subs.toggle_pin_to_top_stream(sub);
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
2018-02-15 20:38:06 +01:00
|
|
|
// Mark all messages in stream as read
|
2017-03-05 17:28:40 +01:00
|
|
|
$('body').on('click', '.mark_stream_as_read', function (e) {
|
|
|
|
var sub = stream_popover_sub(e);
|
|
|
|
exports.hide_stream_popover();
|
2017-08-15 19:34:15 +02:00
|
|
|
unread_ops.mark_stream_as_read(sub.stream_id);
|
2017-03-05 17:28:40 +01:00
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
2018-02-15 20:38:06 +01:00
|
|
|
// Mark all messages as read
|
|
|
|
$('body').on('click', '#mark_all_messages_as_read', function (e) {
|
|
|
|
exports.hide_all_messages_popover();
|
|
|
|
pointer.fast_forward_pointer();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
2019-02-22 12:28:29 +01:00
|
|
|
// Unstar all messages
|
|
|
|
$('body').on('click', '#unstar_all_messages', function (e) {
|
|
|
|
exports.hide_starred_messages_popover();
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
$(".left-sidebar-modal-holder").empty();
|
|
|
|
$(".left-sidebar-modal-holder").html(templates.render("unstar-messages-modal"));
|
|
|
|
$("#unstar-messages-modal").modal("show");
|
|
|
|
});
|
|
|
|
|
|
|
|
$('body').on('click', '#do_unstar_messages_button', function (e) {
|
|
|
|
$("#unstar-messages-modal").modal("hide");
|
|
|
|
message_flags.unstar_all_messages();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
// Mute/unmute
|
|
|
|
$('body').on('click', '.toggle_home', function (e) {
|
|
|
|
var sub = stream_popover_sub(e);
|
|
|
|
exports.hide_stream_popover();
|
|
|
|
subs.toggle_home(sub);
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Unsubscribe
|
|
|
|
$('body').on("click", ".popover_sub_unsub_button", function (e) {
|
|
|
|
$(this).toggleClass("unsub");
|
|
|
|
$(this).closest(".popover").fadeOut(500).delay(500).remove();
|
|
|
|
|
|
|
|
var sub = stream_popover_sub(e);
|
|
|
|
subs.sub_or_unsub(sub);
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Choose custom color
|
|
|
|
$('body').on('click', '.custom_color', function (e) {
|
|
|
|
update_spectrum($(e.target).closest('.streams_popover'), function (colorpicker) {
|
|
|
|
colorpicker.spectrum("destroy");
|
|
|
|
colorpicker.spectrum(stream_color.sidebar_popover_colorpicker_options_full);
|
|
|
|
// In theory this should clean up the old color picker,
|
|
|
|
// but this seems a bit flaky -- the new colorpicker
|
|
|
|
// doesn't fire until you click a button, but the buttons
|
|
|
|
// have been hidden. We work around this by just manually
|
|
|
|
// fixing it up here.
|
|
|
|
colorpicker.parent().find('.sp-container').removeClass('sp-buttons-disabled');
|
|
|
|
$(e.target).hide();
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.streams_popover').on('click', 'a.sp-cancel', function () {
|
|
|
|
exports.hide_stream_popover();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2018-12-14 17:20:35 +01:00
|
|
|
function topic_popover_stream_id(e) {
|
2017-03-05 19:36:36 +01:00
|
|
|
// TODO: use data-stream-id in stream list
|
|
|
|
var stream_id = $(e.currentTarget).attr('data-stream-id');
|
2018-12-14 17:20:35 +01:00
|
|
|
|
|
|
|
return stream_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
function topic_popover_sub(e) {
|
|
|
|
// TODO: use data-stream-id in stream list
|
|
|
|
var stream_id = topic_popover_stream_id(e);
|
2017-03-05 19:36:36 +01:00
|
|
|
if (!stream_id) {
|
|
|
|
blueslip.error('cannot find stream id');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var sub = stream_data.get_sub_by_id(stream_id);
|
|
|
|
if (!sub) {
|
|
|
|
blueslip.error('Unknown stream: ' + stream_id);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return sub;
|
|
|
|
}
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
exports.register_topic_handlers = function () {
|
|
|
|
// Narrow to topic
|
|
|
|
$('body').on('click', '.narrow_to_topic', function (e) {
|
|
|
|
exports.hide_topic_popover();
|
|
|
|
|
2017-03-05 19:36:36 +01:00
|
|
|
var sub = topic_popover_sub(e);
|
|
|
|
if (!sub) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var topic = $(e.currentTarget).attr('data-topic-name');
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
var operators = [
|
2017-03-05 19:36:36 +01:00
|
|
|
{operator: 'stream', operand: sub.name},
|
|
|
|
{operator: 'topic', operand: topic},
|
2017-03-05 17:28:40 +01:00
|
|
|
];
|
2018-04-23 06:02:11 +02:00
|
|
|
narrow.activate(operators, {trigger: 'sidebar'});
|
2017-03-05 17:28:40 +01:00
|
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Mute the topic
|
|
|
|
$('body').on('click', '.sidebar-popover-mute-topic', function (e) {
|
2018-12-14 17:20:35 +01:00
|
|
|
var stream_id = topic_popover_stream_id(e);
|
|
|
|
if (!stream_id) {
|
2017-03-05 19:36:36 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
var topic = $(e.currentTarget).attr('data-topic-name');
|
2018-12-14 17:20:35 +01:00
|
|
|
muting_ui.mute(stream_id, topic);
|
2017-03-05 17:28:40 +01:00
|
|
|
e.stopPropagation();
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Unmute the topic
|
|
|
|
$('body').on('click', '.sidebar-popover-unmute-topic', function (e) {
|
2018-12-14 17:20:35 +01:00
|
|
|
var stream_id = topic_popover_stream_id(e);
|
|
|
|
if (!stream_id) {
|
2017-03-05 19:36:36 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
var topic = $(e.currentTarget).attr('data-topic-name');
|
2018-12-14 17:20:35 +01:00
|
|
|
muting_ui.unmute(stream_id, topic);
|
2017-03-05 17:28:40 +01:00
|
|
|
e.stopPropagation();
|
|
|
|
e.preventDefault();
|
|
|
|
});
|
|
|
|
|
|
|
|
// Mark all messages as read
|
|
|
|
$('body').on('click', '.sidebar-popover-mark-topic-read', function (e) {
|
2018-12-14 18:40:57 +01:00
|
|
|
var stream_id = topic_popover_stream_id(e);
|
|
|
|
if (!stream_id) {
|
2017-03-05 19:36:36 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-03-05 17:28:40 +01:00
|
|
|
var topic = $(e.currentTarget).attr('data-topic-name');
|
|
|
|
exports.hide_topic_popover();
|
2018-12-14 18:40:57 +01:00
|
|
|
unread_ops.mark_topic_as_read(stream_id, topic);
|
2017-03-05 17:28:40 +01:00
|
|
|
e.stopPropagation();
|
|
|
|
});
|
2019-01-18 17:40:54 +01:00
|
|
|
|
|
|
|
// Deleting all message in a topic
|
|
|
|
$('body').on('click', '.sidebar-popover-delete-topic-messages', function (e) {
|
|
|
|
var stream_id = topic_popover_stream_id(e);
|
|
|
|
if (!stream_id) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var topic = $(e.currentTarget).attr('data-topic-name');
|
|
|
|
var args = {
|
|
|
|
topic_name: topic,
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.hide_topic_popover();
|
|
|
|
|
|
|
|
$('#delete-topic-modal-holder').html(templates.render('delete_topic_modal', args));
|
|
|
|
|
|
|
|
$('#do_delete_topic_button').on('click', function () {
|
|
|
|
message_edit.delete_topic(stream_id, topic);
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#delete_topic_modal').modal('show');
|
|
|
|
|
|
|
|
e.stopPropagation();
|
|
|
|
});
|
2017-03-05 17:28:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
return exports;
|
|
|
|
}());
|
|
|
|
|
|
|
|
if (typeof module !== 'undefined') {
|
|
|
|
module.exports = stream_popover;
|
|
|
|
}
|
2018-05-28 08:04:36 +02:00
|
|
|
window.stream_popover = stream_popover;
|