Explorar o código

Fix unwatch button not working in Firefox

Justin Nuß %!s(int64=10) %!d(string=hai) anos
pai
achega
0b4fcf1224
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      public/js/app.js

+ 4 - 2
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;