diff --git a/models/issue.go b/models/issue.go index baf710a5ee..c370af363e 100644 --- a/models/issue.go +++ b/models/issue.go @@ -108,7 +108,17 @@ func NewIssue(issue *Issue) (err error) { sess.Rollback() return err } - return sess.Commit() + + if err = sess.Commit(); err != nil { + return err + } + + if issue.MilestoneId > 0 { + // FIXES(280): Update milestone counter. + return ChangeMilestoneAssign(0, issue.MilestoneId, issue) + } + + return } // GetIssueByIndex returns issue by given index in repository. diff --git a/public/js/app.js b/public/js/app.js index 4c376ea088..88ddd471dc 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; diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl index b689e44299..69f60ba469 100644 --- a/templates/repo/nav.tmpl +++ b/templates/repo/nav.tmpl @@ -31,6 +31,7 @@ + {{if .IsSigned}}
{{if .IsRepositoryWatching}} @@ -52,6 +53,7 @@
+ {{end}}