diff --git a/zephyr/jstemplates/subscription.html b/zephyr/jstemplates/subscription.html
index 37895768b6..b9fe9143ed 100644
--- a/zephyr/jstemplates/subscription.html
+++ b/zephyr/jstemplates/subscription.html
@@ -8,8 +8,7 @@
+ onclick="subs.unsubscribe_button_click(event);">Unsubscribe
|
{{/with}}
diff --git a/zephyr/static/js/subs.js b/zephyr/static/js/subs.js
index e448c79e67..3d3ce31205 100644
--- a/zephyr/static/js/subs.js
+++ b/zephyr/static/js/subs.js
@@ -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({
type: "POST",
url: "/json/subscriptions/remove",