static/js/settings_streams.js: Move delete_stream func to stream_edit.js.

This commit is contained in:
Yashashvi Dave
2018-04-30 17:38:10 +05:30
parent 7bbe44d7a0
commit 8729c9001d
2 changed files with 13 additions and 13 deletions

View File

@@ -141,18 +141,6 @@ exports.set_up = function () {
});
};
exports.delete_stream = function (stream_id, alert_element, stream_row) {
channel.del({
url: '/json/streams/' + stream_id,
error: function (xhr) {
ui_report.error(i18n.t("Failed"), xhr, alert_element);
},
success: function () {
stream_row.remove();
},
});
};
return exports;
}());

View File

@@ -457,6 +457,18 @@ exports.change_stream_description = function (e) {
});
};
exports.delete_stream = function (stream_id, alert_element, stream_row) {
channel.del({
url: '/json/streams/' + stream_id,
error: function (xhr) {
ui_report.error(i18n.t("Failed"), xhr, alert_element);
},
success: function () {
stream_row.remove();
},
});
};
$(function () {
$("#zfilt").on("click", ".stream_sub_unsub_button", function (e) {
e.preventDefault();
@@ -617,7 +629,7 @@ $(function () {
return;
}
var row = $(".stream-row.active");
settings_streams.delete_stream(stream_id, $(".stream_change_property_info"), row);
exports.delete_stream(stream_id, $(".stream_change_property_info"), row);
$(".settings").hide();
$(".nothing-selected").show();
});