From 0b4fcf12244c85653e92c87293f63024301d8a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Justin=20Nu=C3=9F?= Date: Tue, 22 Jul 2014 11:56:08 +0200 Subject: [PATCH] Fix unwatch button not working in Firefox --- public/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index 4c376ea08..88ddd471d 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -406,8 +406,10 @@ function initRepository() { // watching script (function () { var $watch = $('#repo-watching'), - watchLink = $watch.data("watch"), - unwatchLink = $watch.data("unwatch"); + watchLink = $watch.attr("data-watch"), + // Use $.attr() to work around jQuery not finding $.data("unwatch") in Firefox, + // which has a method "unwatch" on `Object` that gets returned instead. + unwatchLink = $watch.attr("data-unwatch"); $watch.on('click', '.to-watch', function () { if ($watch.hasClass("watching")) { return false;