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
| commit b9dc87d66c0606908b3199e08ce261e2425d1ef6 | |
| Author: Tim Evans <tim.evans@junctionnetworks.com> | |
| Date: Wed Feb 29 12:36:06 2012 -0500 | |
| separated views into their own files for reuse | |
| diff --git a/apps/todos_two/resources/main_page.js b/apps/todos_two/resources/main_page.js | |
| index e5d620b..c17be8d 100644 | |
| --- a/apps/todos_two/resources/main_page.js | |
| +++ b/apps/todos_two/resources/main_page.js |
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
| TodosThree.STARTING = SC.State.extend({ | |
| enterState: function () { | |
| if (SC.instanceOf(TodosTwo.store.dataSource, SC.FixturesDataSource)) { | |
| this.gotoState('LOADING_DATA'); | |
| } else { | |
| this.gotoState('LOGGING_IN'); | |
| } | |
| }, |
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
| var getStyle = function (el, name) { | |
| var style; | |
| if (el.currentStyle) { | |
| style = el.currentStyle[name]; | |
| } else if (window.getComputedStyle) { | |
| style = document.defaultView.getComputedStyle(el, null).getPropertyValue(name); | |
| } | |
| return style; | |
| }; |
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
| MyApp = {}; | |
| MyApp.myController = SC.ObjectController.create({ | |
| content: SC.Object.create({ | |
| proxiedName: 'Bruce Wayne', | |
| maskedName: 'Bats' | |
| }), | |
| maskedName: 'Batman' | |
| }); |
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
| SC.AutoScrollTextSupport = { | |
| scrollView: function () { | |
| var view = this.get('parentView'); | |
| while (view && !view.isScrollable) { | |
| view = view.get('parentView'); | |
| } | |
| return view; |
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
| SC._animationBuffer = []; | |
| /** | |
| If you try to animate a view that was previously | |
| `isVisible`: `NO`, you have to set the view to be | |
| `isVisible`: `YES`, then at the *next* run loop, | |
| try to animate the view, but only after forcing | |
| the browser to repaint the view. | |
| This function does all that for you, albeit |
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
| (function () { | |
| // Implement debounce until backburner implements a proper debounce | |
| var debouncees = [], | |
| pop = Array.prototype.pop; | |
| var debounce = function (target, method /*, args, wait */) { | |
| var self = Ember.run.backburner, | |
| args = arguments, | |
| wait = pop.call(args), |
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
| /** | |
| The `{{t}}` helper renders a localized string using `I18n.t`. | |
| ```handlebars | |
| {{t "app.hello_world"}} | |
| ``` | |
| ```html | |
| Hello, World! | |
| ``` |
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
| /** | |
| The `{{l}}` helper renders a localized string using `I18n.l`. | |
| ```handlebars | |
| {{l "percentage" value=123.45}} | |
| ``` | |
| ```html | |
| 123.450% | |
| ``` |