=>I think "return true;" if better so the click event can delegate to parents.
$(document).delegate('a', 'click.history-' + this.app.eventNamespace(), function (e) {
if (e.isDefaultPrevented() || e.metaKey || e.ctrlKey) {
return;
}
var full_path = lp.fullPath(this),
// Get anchor's host name in a cross browser compatible way.
// IE looses hostname property when setting href in JS
// with a relative URL, e.g. a.setAttribute('href',"/whatever").
// Circumvent this problem by creating a new link with given URL and
// querying that for a hostname.
hostname = this.hostname ? this.hostname : function (a) {
var l = document.createElement("a");
l.href = a.href;
return l.hostname;
}(this);
=>I think "return true;" if better so the click event can delegate to parents.
$(document).delegate('a', 'click.history-' + this.app.eventNamespace(), function (e) { if (e.isDefaultPrevented() || e.metaKey || e.ctrlKey) { return; } var full_path = lp.fullPath(this), // Get anchor's host name in a cross browser compatible way. // IE looses hostname property when setting href in JS // with a relative URL, e.g. a.setAttribute('href',"/whatever"). // Circumvent this problem by creating a new link with given URL and // querying that for a hostname. hostname = this.hostname ? this.hostname : function (a) { var l = document.createElement("a"); l.href = a.href; return l.hostname; }(this);