diff --git a/js/examples/eve/crazy-mikes/index.html b/js/examples/eve/crazy-mikes/index.html index 6b31497..b831485 100644 --- a/js/examples/eve/crazy-mikes/index.html +++ b/js/examples/eve/crazy-mikes/index.html @@ -16,7 +16,7 @@
diff --git a/js/examples/eve/crazy-mikes/index.js b/js/examples/eve/crazy-mikes/index.js index 62cb6c4..755d214 100644 --- a/js/examples/eve/crazy-mikes/index.js +++ b/js/examples/eve/crazy-mikes/index.js @@ -6,8 +6,10 @@ function spawnNavBar(defaultPage) { field this.currentPage = defaultPage; assert currentPage(this.currentPage); on message Syndicate.UI.globalEvent('.nav-btn', 'click', $e) { - // INVARIANT: the text content of each nav bar button is the page name - this.currentPage = e.originalTarget.textContent; + // INVARIANT: the id of each nav bar button is of the form 'nav-btn-Name', + // where Name is the name of the page associated with that button + var newPage = e.target.id.match(/nav-btn-(.*)/)[1]; + this.currentPage = newPage; } } }