iPad 1 (normal) | iPhone 4 (normal) | iPad 1 (pre-run) | iPhone 4 (pre-run) | |
---|---|---|---|---|
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
// ========================================================================== | |
// Project: SC.CollectionColumnDelegate | |
// Copyright: ©2009 My Company, Inc. | |
// ========================================================================== | |
/*globals SC */ | |
/** | |
@namespace | |
CollectionColumnDelegates are consulted by SC.HorizontalListView to |
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
/** | |
* Imagine if you will that the content of this controller is set to a bunch of MyApp.Person records. For whatever reason | |
* we don't want to pass those records as is to the controller or view using peopleController objects. | |
*/ | |
MyApp.peopleController = SC.ArrayController.create({ | |
// Override to provide the proper object for our consumer of peopleController objects. | |
objectAt: function (idx) { | |
var content = this.get('content'), | |
person, |
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
/** | |
* A view that adds an 'active' class when the mouse is over it. | |
*/ | |
MyApp.MyView = SC.View.extend(SC.StatechartManager, { | |
/** @private */ | |
displayProperties: ['isActive', 'isEnabled'], | |
/** | |
Whether the view is active or not. |
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
myStack: SC.StackedView.extend({ | |
// Observes changes to our content. | |
contentDidChange: function () { | |
var previousContent = this.previousContent, | |
this.get('content'); | |
// Clean up observer on previous content | |
if (previousContent) { |
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
/** | |
This mixin automatically positions the view's child views in a stack either | |
vertically or horizontally and adjusts the View's height or width respectively | |
to fit. It does this by checking the height or width of each child view | |
(depending on the direction of layout) and positioning the following child view | |
accordingly. | |
If the child view's frame changes, then the parent view will re-layout all of | |
the others to fit and re-adjust its width or height to fit as well. |
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
// ========================================================================== | |
// Project: SproutCore - JavaScript Application Framework | |
// Copyright: ©2006-2011 Strobe Inc. and contributors. | |
// Portions ©2008-2011 Apple Inc. All rights reserved. | |
// License: Licensed under MIT license (see license.js) | |
// ========================================================================== | |
/** | |
This mixin should be applied to all control views. |
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 items = Items.store.find('Items.Item'); | |
// Don't need this | |
//Items.selectedItemsController.set('content',[]); | |
Items.mainItemsController.set('content', items); | |
/* ... */ |
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
/* | |
Apply this mixin to a pane to make it slide in from the top and fill the screen. The pane should not override layout. | |
*/ | |
MyApp.FullScreenSheetPane = { | |
// May not be necessary in your app | |
defaultResponder: MyApp, | |
// Make sure it is offscreen (these values will be auto-adjusted) | |
layout: { top: −200, left: 0, height: 200, right: 0 }, |
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
// at the end of main.js... | |
var buttonView = SC.ButtonView.create({ | |
layout: { left: -1000, width: 100, height: 24, top: 0 }, | |
didAppendToDocument: function() { | |
var self = this, | |
layer = this.get('layer'), | |
params; | |
params = { |