Permalink
Browse files

Merge branch 'master' of https://github.com/facebook/javelin

  • Loading branch information...
2 parents 922749a + 1006c35 commit adfcfcfcb817cf9e68e3c18331e2a1be1ab87aa3 @dougli dougli committed Oct 12, 2012
View
@@ -185,6 +185,10 @@ JX.install('URI', {
}
str += this.getDomain() || '';
+ if (this.getPort()) {
+ str += ':' + this.getPort();
+ }
+
// If there is a domain or a protocol, we need to provide '/' for the
// path. If we don't have either and also don't have a path, we can omit
// it to produce a partial URI without path information which begins
@@ -4,9 +4,10 @@
describe('Javelin URI', function() {
it('should understand parts of a uri', function() {
- var uri = JX.$U('http://www.facebook.com/home.php?key=value#fragment');
+ var uri = JX.$U('http://www.facebook.com:123/home.php?key=value#fragment');
expect(uri.getProtocol()).toEqual('http');
expect(uri.getDomain()).toEqual('www.facebook.com');
+ expect(uri.getPort()).toEqual('123');
expect(uri.getPath()).toEqual('/home.php');
expect(uri.getQueryParams()).toEqual({'key' : 'value'});
expect(uri.getFragment()).toEqual('fragment');
@@ -325,6 +325,15 @@ JX.install('Typeahead', {
/**
* @task control
*/
+ enable : function() {
+ this._control.disabled = false;
+ this._stop = false;
+ },
+
+
+ /**
+ * @task control
+ */
disable : function() {
this._control.blur();
this._control.disabled = true;
@@ -45,13 +45,13 @@ JX.install('TypeaheadCompositeSource', {
},
childWaiting : function() {
- if (!this.results.length) {
+ if (!this.results || !this.results.length) {
this.invoke('waiting');
}
},
childResultsReady : function(nodes) {
- this.results = this.mergeResults(this.results, nodes);
+ this.results = this.mergeResults(this.results || [], nodes);
this.invoke('resultsready', this.results);
},

0 comments on commit adfcfcf

Please sign in to comment.