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
ClientHub.loggedOutView = Em.View.extend({ | |
templateName: "login", | |
LoginFormView: Em.View.extend({ | |
errorMsg: null, | |
error: null, | |
username: null, | |
password: null, | |
submitLogin:function(){ | |
ClientHub.LoginManager.send('login', {username: this.get('username'), |
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
App.CarouselView = Em.CollectionView.extend(Luh.Ui.ScrollMixin, { | |
scrollOptions: { | |
hScroll: true, | |
vScroll: false, | |
duration: 500, | |
velocity: 0.1, | |
simultaneously: true, | |
initThreshold: 10*ScreenFactor | |
}, |
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
Test = SC.Application.create({ NAMESPACE: 'Test', VERSION: '0.1.0', store: SC.Store.create().from(SC.Record.fixtures) }) ; | |
Test.Top = SC.Record.extend({ | |
middles: SC.Record.toMany( | |
SC.Record.extend({ | |
bottoms: SC.Record.toMany( | |
SC.Record, | |
{ | |
isNested: YES, | |
isMaster: NO |
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
AnimatableView = Ember.ContainerView.extend(Em.Animatable,{ | |
executeAnimation: function() { | |
....... | |
this.animate({duration: that.duration, stopEventHandling:true}, function() { | |
# perform animations based on your JS choices | |
move('#'+id) | |
.x(translatePosition) |
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
App = Ember.Application.create({}); | |
App.loginController = Ember.Object.create({ | |
// do login stuff | |
}); | |
App.LoginFormView = Ember.View.extend({ | |
login: null, | |
password: null, |
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
App.ClickableView = Ember.View.extend({ | |
click: function(evt) { | |
console.log("ClickableView was clicked!"); | |
} | |
}); |
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
module("Ember.StateManager - nested StateManagers", { | |
setup: function() { | |
var State = Ember.State.extend(stateEventStub); | |
stateManager = Ember.StateManager.create(stateEventStub, { | |
grandparentA: State.create({ | |
parent: Ember.StateManager.create(stateEventStub, { | |
child: State.create(), | |
sibling: State.create() | |
}), |
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 State = Ember.State.extend({}); | |
var ViewState = Ember.ViewState.extend({}); | |
// existing | |
App.statechart = Ember.StateManager.create({ | |
loggedOut: ViewState.create({}), | |
loggingIn: ViewState.create({}), | |
loggedIn: Ember.StateManager.create({ | |
appLoadFailed: ViewState.create({}), | |
appLoading: ViewState.create({}), |
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 State = Ember.State.extend({}); | |
var ViewState = Ember.ViewState.extend({}); | |
App.statechart = Ember.StateManager.create({ | |
loggedOut: ViewState.create({}), | |
loggingIn: ViewState.create({}), | |
loggedIn: State.create({ | |
appLoadFailed: ViewState.create({}), | |
appLoading: ViewState.create({}), | |
appLoaded: State.create({ |
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
CliffDetector.stateManager = Ember.StateManager.create | |
rootElement: $("div[data-role=content]") | |
map: Ember.ViewState.create | |
view: CliffDetector.MapView.create() | |
enter: (stateManager) -> | |
@_super(stateManager) | |
console.log "hello" |