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
console.log('----------------- SANDBOX START -----------------') | |
var contentObjectController = SC.ObjectController.create() | |
var ContentView = SC.View.extend(SC.ContentDisplay, { | |
layout: function() { | |
var something = this.get('content') ? this.get('content') : {get: function(attribute) { return 0;} }; | |
return {top: something.get('row') * 100, left: something.get('column') * 100, height: 100, width: 100}; | |
}.property('content').cacheable() |
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
layout: function() { | |
var something = this.get('content'); | |
return {top: something.get('row') * 100, left: something.get('column') * 100, height: 100, width: 100}; | |
}.property('content').cacheable() |
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
Chatter.userController = SC.ObjectController.create( | |
/** @scope Chatter.userController.prototype */ { | |
loggedInAs: function(){ | |
var user = this.get('content'); | |
return "Logged in as " + user.get('name'); | |
}.property('name').cacheable() | |
}) ; |
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.roomsController = SC.ArrayController.create({ | |
contentBinding: 'ClientWasp.userController.rooms', | |
}); |
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
render: function(context, firstTime){ | |
context.push( | |
'<div id="something" class="some-class">', | |
'<div id="some-other-div" class="some-other-class">', | |
someVariable, | |
'</div>', | |
'</div>'); |
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
//Things that look like this: | |
initialLength = tasks.length(); | |
//Should be changed to look like this: | |
initialLength = tasks.get('length'); |
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
//Replace instances which look like: | |
Todos.getPath('mainPage.mainPane.middleView.contentView') | |
//With something that looks like this: | |
Todos.mainPage.todosList(); | |
//And add the following to main_page.js | |
Todos.mainPage = SC.Page.design({ | |
todosList: SC.outlet('mainPane.middleView.contentView'), | |
... | |
}) |
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
Then I should see "No Tasks" within the tasks count section of the page, expected No Tasks result "" |
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
Todos.mainPage = SC.Page.design({ | |
mainPane: SC.MainPane.design({ | |
childViews: 'topView middleView bottomView'.w(), | |
topView: SC.ToolbarView.design({ | |
layout: {top: 0, left: 0, right: 0, height: 36 }, //ADDED THIS | |
anchorLocation: SC.ANCHOR_TOP, //ADDED THIS | |
childViews: 'addTaskButton'.w(), | |
addTaskButton: SC.ButtonView.design({ |
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
Todos.tasksController = SC.ArrayController.create({ | |
countSummary: function() { | |
var length = this.get('length'); | |
if(length == 0) | |
return 'No Tasks'; | |
else | |
return length == 1 ? '1 Task' : "%@ Tasks".fmt(length); | |
}.property('length').cacheable(), |