Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added removed buildUrl

  • Loading branch information...
commit f1f7556f6a002c7d1da9da64b3ac640dd7c6f7c0 1 parent 860dece
@diervo diervo authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 lib/app/autoload/store.client.js
View
24 lib/app/autoload/store.client.js
@@ -202,6 +202,30 @@ YUI.add('mojito-client-store', function(Y, NAME) {
*/
getRoutes: function() {
return this.routes;
+ },
+
+ /**
+ * Checks the given URL and adds a context query string.
+ * @param url {String} the relative url
+ * @param context {Object} the runtime context
+ * @return {String}
+ */
+ buildUrl: function (url, context) {
+
+ if ('/' !== url.charAt(0)) {
+ url = '/' + url;
+ }
+
+ // this is mainly used by html5app
+ if (this.appConfig.pathToRoot) {
+ url = this.appConfig.pathToRoot + url;
+ }
+
+ if (context) {
+ url += '?' + Y.QueryString.stringify(context);
+ }
+
+ return url;
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.