Skip to content

Commit

Permalink
fidRemove works with current URL
Browse files Browse the repository at this point in the history
Fixes error when extension returned old URL, that was changed by another Javascript meanwhile.
  • Loading branch information
vojtech-dobes committed Mar 6, 2013
1 parent e0bc992 commit 17098e1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions extensions/fidRemove.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ if (!(window.history && history.pushState && window.history.replaceState && !nav

$.nette.ext('fidRemove', {
init: function () {
var url = window.location.toString();
var pos = url.indexOf('_fid=');
if (pos !== -1) {
url = this.removeFid(url, pos);
setTimeout(function () {
window.history.replaceState({}, null, url);
}, this.timeout);
}
var that = this;
setTimeout(function () {
var url = window.location.toString();
var pos = url.indexOf('_fid=');
if (pos !== -1) {
window.history.replaceState({}, null, that.removeFid(url, pos));
}
}, this.timeout);
}
}, {
timeout: 3000,
Expand Down

0 comments on commit 17098e1

Please sign in to comment.