Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
only replace the first mention of 'metrics' in the pathname, fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
obfuscurity committed Mar 1, 2014
1 parent 6968344 commit 353bc09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/dusk/public/js/dusk.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var Dusk = function(target) {
dataType: 'json',
error: function(xhr, textStatus, errorThrown) { console.log(errorThrown) },
type: 'POST',
url: window.location.href.replace(/metrics/, 'favorites')
url: window.location.pathname.replace(/metrics/, 'favorites')
}).done(function(d) {
console.log('favorite successful')
cb()
Expand All @@ -106,7 +106,7 @@ var Dusk = function(target) {
dataType: 'json',
error: function(xhr, textStatus, errorThrown) { console.log(errorThrown) },
type: 'DELETE',
url: window.location.href.replace(/metrics/, 'favorites')
url: window.location.pathname.replace(/metrics/, 'favorites')
}).done(function(d) {
console.log('unfavorite successful')
cb()
Expand Down

0 comments on commit 353bc09

Please sign in to comment.