Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In it's simplest form, you can use <code>StateManager</code>. Please see the following fiddle I created: <a href="http://jsfiddle.net/npCfF/" rel="nofollow">http://jsfiddle.net/npCfF/</a></p> <p><strong>Javascript:</strong></p> <pre><code>App= Ember.Application.create(); App.StateManager = Ember.StateManager.create({ rootElement: '.tab-content', initialState: 'tab1', //Show the location tab function showTab1: function(manager) { manager.transitionTo('tab1'); }, //show seleceted areas showTab2: function(manager) { manager.transitionTo('tab2'); }, showTab3: function(manager) { this.set('locationActive', 'inactive'); this.set('areasActive', 'active'); this.set('filterActive', 'inactive'); this.set('childOf', 'showAreas'); manager.transitionTo('tab3'); }, tab1: Ember.ViewState.create({ route: 'tab1', view: Ember.View.create({ templateName: 'tab1' }) }), tab2: Ember.ViewState.create({ route: 'tab2', view: Ember.View.create({ templateName: 'tab2' }) }), tab3: Ember.ViewState.create({ route: 'tab3', view: Ember.View.create({ templateName: 'tab3' }) }) }); ​ </code></pre> <p><strong>HTML:</strong></p> <pre><code>&lt;script type="text/x-handlebars"&gt; &lt;nav class="tab_menu"&gt; &lt;span id="tab_location_result" data-show="location_result" {{action "showTab1" target="App.StateManager"}}&gt;&lt;i class="icon-globe"&gt;&lt;/i&gt;Tab 1&lt;/span&gt; | &lt;span id="tab_selected_areas" data-show="selected_areas" {{bindAttr class="MapSearch.StateManager.areasActive"}} {{action "showTab2" target="App.StateManager"}}&gt;&lt;i class="icon-map-marker"&gt;&lt;/i&gt;Tab 2&lt;/span&gt; | &lt;span id="tab_filter_results" data-show="filter_results" {{bindAttr class="MapSearch.StateManager.filterActive"}} {{action "showTab3" target="App.StateManager"}}&gt;&lt;i class="icon-filter"&gt;&lt;/i&gt;Tab 3&lt;/span&gt; &lt;/nav&gt; &lt;/script&gt; &lt;div class="tab-content"&gt;&lt;/div&gt; &lt;script type="text/x-handlebars" data-template-name="tab1"&gt; Tab1 &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="tab2"&gt; Tab2 &lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="tab3"&gt; Tab3 &lt;/script&gt; ​ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload