Skip to content

Commit

Permalink
$$.to with target
Browse files Browse the repository at this point in the history
Update initialize.js
  • Loading branch information
lesichkovm authored Sep 3, 2019
2 parents 6022664 + 4e32cd5 commit 908edcd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ function Initialize() {
return language;
};

this.to = function (url, data) {
this.to = function (url, data, options) {
if (url.match("^http://") || url.match("^https://")) {
// External url
} else {
Expand All @@ -399,7 +399,14 @@ function Initialize() {
url = url + (url.indexOf('?') <0 ? '?' : '&') + queryString;
}

window.location.href = url;
var options = (typeof options === 'undefined') ? {} : options;

if(options.target === "_blank") {
window.location.href = url;
window.open(url, '_blank', "resizable,scrollbars,status");
} else {
window.location.href = url;
}

return false; // otherwise links will be triggered
};
Expand Down

0 comments on commit 908edcd

Please sign in to comment.