Created
July 21, 2015 21:07
-
-
Save jakewhiteley/4417c4206d7be12fb462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AppPath = '/teimr/', | |
App = blocks.Application({ | |
history: 'pushState' | |
}); | |
App.View('Navigation', { | |
options: { | |
url: AppPath + 'views/navigation.html', | |
}, | |
// populates the side nav with tags | |
sideNav: blocks.observable([1, 2, 3]), | |
ready: function() { | |
console.log('nav loaded') | |
} | |
}); | |
App.View('Main', { | |
options: { | |
url: AppPath + 'views/main.html', | |
}, | |
ready: function() { | |
console.log($('ul.tabs'), 'main loaded') | |
} | |
}); |
Navigation.html:
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a href="#test1">Test 1</a></li>
<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>
<li class="tab col s3 disabled"><a href="#test3">Disabled Tab</a></li>
<li class="tab col s3"><a href="#test4">Test 4</a></li>
</ul>
</div>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 4</div>
</div>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
index.html is as follows:
The issue is that neither ready method has access to the rendered DOM of the template associated with it's view.