Permalink
Browse files

Merge branch 'pjax-root' into app-root

  • Loading branch information...
2 parents 07e6a3c + 981bda6 commit a3a2c6b505c8e55c6078e6c996bb1973121eaa74 @ericf committed Nov 14, 2011
@@ -16,7 +16,10 @@ PjaxBase.prototype = {
// -- Lifecycle Methods ----------------------------------------------------
initializer: function () {
this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});
- this._pjaxBindUI();
+
+ if (this.get('html5')) {
+ this._pjaxBindUI();
+ }
},
destructor: function () {
@@ -71,7 +74,7 @@ PjaxBase.prototype = {
},
_pjaxBindUI: function () {
- if (this.get('html5')) {
+ if (!this._pjaxEvents) {
this._pjaxEvents = Y.one('body').delegate('click',
this._onLinkClick, this.get('linkSelector'), this);
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -16,7 +16,10 @@ PjaxBase.prototype = {
// -- Lifecycle Methods ----------------------------------------------------
initializer: function () {
this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});
- this._pjaxBindUI();
+
+ if (this.get('html5')) {
+ this._pjaxBindUI();
+ }
},
destructor: function () {
@@ -71,7 +74,7 @@ PjaxBase.prototype = {
},
_pjaxBindUI: function () {
- if (this.get('html5')) {
+ if (!this._pjaxEvents) {
this._pjaxEvents = Y.one('body').delegate('click',
this._onLinkClick, this.get('linkSelector'), this);
}
@@ -821,10 +821,8 @@ Y.Router = Y.extend(Router, Y.Base, {
url: urlIsString ? this._joinURL(url) : url
});
} else {
- if (urlIsString && url.charAt(0) !== '/') {
- url = '/' + url;
- }
-
+ // Remove the root from the URL before it's set as the hash.
+ urlIsString && (url = this.removeRoot(url));
HistoryHash[replace ? 'replaceHash' : 'setHash'](url);
}
@@ -969,4 +967,4 @@ version of YUI.
Y.Controller = Y.Router;
-}, '@VERSION@' ,{requires:['array-extras', 'base-build', 'history'], optional:['querystring-parse']});
+}, '@VERSION@' ,{optional:['querystring-parse'], requires:['array-extras', 'base-build', 'history']});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -819,10 +819,8 @@ Y.Router = Y.extend(Router, Y.Base, {
url: urlIsString ? this._joinURL(url) : url
});
} else {
- if (urlIsString && url.charAt(0) !== '/') {
- url = '/' + url;
- }
-
+ // Remove the root from the URL before it's set as the hash.
+ urlIsString && (url = this.removeRoot(url));
HistoryHash[replace ? 'replaceHash' : 'setHash'](url);
}
@@ -967,4 +965,4 @@ version of YUI.
Y.Controller = Y.Router;
-}, '@VERSION@' ,{requires:['array-extras', 'base-build', 'history'], optional:['querystring-parse']});
+}, '@VERSION@' ,{optional:['querystring-parse'], requires:['array-extras', 'base-build', 'history']});
View
@@ -819,10 +819,8 @@ Y.Router = Y.extend(Router, Y.Base, {
url: urlIsString ? this._joinURL(url) : url
});
} else {
- if (urlIsString && url.charAt(0) !== '/') {
- url = '/' + url;
- }
-
+ // Remove the root from the URL before it's set as the hash.
+ urlIsString && (url = this.removeRoot(url));
HistoryHash[replace ? 'replaceHash' : 'setHash'](url);
}
View
@@ -14,7 +14,10 @@ PjaxBase.prototype = {
// -- Lifecycle Methods ----------------------------------------------------
initializer: function () {
this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});
- this._pjaxBindUI();
+
+ if (this.get('html5')) {
+ this._pjaxBindUI();
+ }
},
destructor: function () {
@@ -69,7 +72,7 @@ PjaxBase.prototype = {
},
_pjaxBindUI: function () {
- if (this.get('html5')) {
+ if (!this._pjaxEvents) {
this._pjaxEvents = Y.one('body').delegate('click',
this._onLinkClick, this.get('linkSelector'), this);
}

0 comments on commit a3a2c6b

Please sign in to comment.