mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 14:08:23 +00:00
Remove unescaped use of stream name in subscriptions page.
This was causing issues with our ability to unsubscribe from streams with " in their names. The solution here is a bit hacky, since it depends on the JavaScript being fairly aware of the layout of the DOM, which is not great. But it works. This fixes Trac #328. (imported from commit a1b6c8e1f3a9daacdc48920a195717aa89b3a9a9)
This commit is contained in:
@@ -8,8 +8,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="span2">
|
<td class="span2">
|
||||||
<button class="btn btn-block" type="button" name="subscription"
|
<button class="btn btn-block" type="button" name="subscription"
|
||||||
onclick="subs.unsubscribe('{{subscription}}');"
|
onclick="subs.unsubscribe_button_click(event);">Unsubscribe</button>
|
||||||
value="{{subscription}}">Unsubscribe</button>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/with}}
|
{{/with}}
|
||||||
|
|||||||
@@ -229,7 +229,8 @@ function ajaxSubscribe(stream) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.unsubscribe = function (stream) {
|
exports.unsubscribe_button_click = function (e) {
|
||||||
|
var stream = $(e.target).parent().prev().find('.subscription_name').text();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/json/subscriptions/remove",
|
url: "/json/subscriptions/remove",
|
||||||
|
|||||||
Reference in New Issue
Block a user