Last active
February 15, 2017 01:14
-
-
Save rileyhilliard/565939b8d37b315aae854172cf007cd0 to your computer and use it in GitHub Desktop.
link-to bug
This file contains hidden or 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
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| routes: [ | |
| '0', | |
| '1', | |
| '2', | |
| '3', | |
| '4', | |
| '5', | |
| '6', | |
| '7', | |
| '8', | |
| '9' | |
| ], | |
| }); |
This file contains hidden or 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
| import Ember from 'ember'; | |
| import config from './config/environment'; | |
| const Router = Ember.Router.extend({ | |
| location: 'none', | |
| rootURL: config.rootURL | |
| }); | |
| Router.map(function() { | |
| this.route('thread', { path: '/:id' }); | |
| }); | |
| export default Router; |
This file contains hidden or 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
| import Ember from 'ember'; | |
| export default Ember.Route.extend({ | |
| actions: { | |
| willTransition(transition) { | |
| this._super(...arguments); | |
| // If the user wants to transition, reset and return | |
| if (this.continueTransition) { | |
| // reset users selection | |
| this.continueTransition = false; | |
| return false; | |
| } | |
| transition.abort(); | |
| var previousTransition = this.getWithDefault('previousTransition', transition); | |
| this.set('previousTransition', previousTransition); | |
| var transitionToNewRoute = confirm("Are you sure you want to navigate to a new route?"); | |
| if (transitionToNewRoute) { | |
| this.continueTransition = true; | |
| previousTransition.retry(); | |
| } | |
| } | |
| } | |
| }); |
This file contains hidden or 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
| body { | |
| margin: 12px 16px; | |
| font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
| font-size: 12pt; | |
| } | |
| .active { | |
| background: red; | |
| } | |
| ul span { | |
| display: none; | |
| } | |
| .active span { | |
| display: inline; | |
| } | |
| ul { | |
| list-style: none; | |
| } |
This file contains hidden or 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
| { | |
| "version": "0.11.0", | |
| "EmberENV": { | |
| "FEATURES": {} | |
| }, | |
| "options": { | |
| "use_pods": false, | |
| "enable-testing": false | |
| }, | |
| "dependencies": { | |
| "jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
| "ember": "2.10.2", | |
| "ember-data": "2.11.0", | |
| "ember-template-compiler": "2.10.2", | |
| "ember-testing": "2.10.2" | |
| }, | |
| "addons": {} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment