Fixed a few bugs with route matching for router view and router links.
This commit is contained in:
		| @@ -43,13 +43,13 @@ class RouterLink extends IgniteElement { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     update() { |     update() { | ||||||
|         var routeMatches = true; |         var routeMatches = false; | ||||||
|  |  | ||||||
|         //Check the target first. |         //Check the target first. | ||||||
|         routeMatches = RouteMatcher.matches(this.target); |         routeMatches = RouteMatcher.matches(this.target); | ||||||
|  |  | ||||||
|         //Check optional routes next. |         //Check optional routes next. | ||||||
|         for (var i = 0; i < this.routes.length && routeMatches; i++) { |         for (var i = 0; i < this.routes.length && !routeMatches; i++) { | ||||||
|             routeMatches = RouteMatcher.matches(this.routes[i]); |             routeMatches = RouteMatcher.matches(this.routes[i]); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -101,12 +101,14 @@ class RouterView extends IgniteElement { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     update() { |     update() { | ||||||
|         var routeMatches = true; |         var routeMatches = false; | ||||||
|  |  | ||||||
|         for (var i = 0; i < this.routes.length && routeMatches; i++) { |         //Check all of the possible routes until we find a match. | ||||||
|  |         for (var i = 0; i < this.routes.length && !routeMatches; i++) { | ||||||
|             routeMatches = RouteMatcher.matches(this.routes[i]); |             routeMatches = RouteMatcher.matches(this.routes[i]); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         //If we found a match show this router view if it's not already visible, otherwise hide it. | ||||||
|         if (routeMatches && !this.show) { |         if (routeMatches && !this.show) { | ||||||
|             this.show = true; |             this.show = true; | ||||||
|         } else if (!routeMatches && this.show) { |         } else if (!routeMatches && this.show) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user