Skip to content

Instantly share code, notes, and snippets.

View ColinCampbell's full-sized avatar

Colin Campbell ColinCampbell

View GitHub Profile

Proposed View-layer changes

Friday, Juan, Tom, Yehuda and I had a meeting where we discussed the renderer APIs and some ideas we had for the view layer. Here is what we came up with:

Overview

The purpose of these proposed changes is to lower the learning curve for users entering the SproutCore world and who are looking for quick feedback and an easy way to create custom views

From a7a64cf081f4cbf30371bdc0503a93636548910d Mon Sep 17 00:00:00 2001
From: Colin Campbell <[email protected]>
Date: Wed, 13 Oct 2010 23:12:29 -0400
Subject: [PATCH] Allows for easier binding in the form of 'foo: SC.binding(...)' rather than fooBinding: '...'
---
frameworks/runtime/system/object.js | 13 +++++++++
frameworks/runtime/tests/system/object/bindings.js | 28 ++++++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
MyClass = SC.Object.extend({
name: function() {
var name = this.getPath('content.name');
// probably want to do something here
return name;
}.property().cacheable(),
nameWillChange: function() {
From 12f045ea50d51ed886d7fe0d439d3fad2abac498 Mon Sep 17 00:00:00 2001
From: Colin Campbell <[email protected]>
Date: Thu, 9 Sep 2010 16:07:48 -0400
Subject: [PATCH] Fixed enterState being called before state is considered entered
---
frameworks/foundation/system/statechart.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/frameworks/foundation/system/statechart.js b/frameworks/foundation/system/statechart.js
diff --git a/frameworks/foundation/views/view.js b/frameworks/foundation/views/v
index f7a29fb..07261d3 100644
--- a/frameworks/foundation/views/view.js
+++ b/frameworks/foundation/views/view.js
@@ -2306,7 +2306,7 @@ SC.View = SC.Responder.extend(SC.DelegateSupport,
for(key in this._activeAnimations){
// TODO: Check for more than duration
if (
- newStyle[key] !== currentStyle[key] ||
+ newStyle[key] !== (currentStyle && currentStyle[key]) ||
/**
An Accessory is an embeddable mini-application. It can have its own set of controllers,
states, and views. Accessories are useful pattern for building independent, reusable plugins
inside of your application.
*/
SC.Accessory = SC.Object.extend({
concatenatedProperties: 'automaticallyInitialize'.w(),
// FIXME: this name sucks
project: sproutcore
commits: 4451
files : 1479
authors:
1224 Charles Jolley
419 Juan Pinzon
397 Erich Ocean
285 Alex Iskander
281 Tom Dale
project: sproutcore
commits: 4156
files : 1062
authors:
1219 Charles Jolley
434 Juan Pinzon
397 Erich Ocean
291 Tom Dale
192 Onar Vikingstad
From 9297ae9b2894fddc058d1822731ade9d2a4518c6 Mon Sep 17 00:00:00 2001
From: Colin Campbell <[email protected]>
Date: Tue, 24 Aug 2010 16:52:33 -0230
Subject: [PATCH] Fixed issue with SC.ManyArray not notifying inverse attributes of correct records that got removed in SC.ManyArray#replace, with tests.
---
frameworks/datastore/system/many_array.js | 2 +-
.../datastore/tests/models/many_attribute.js | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletions(-)
// in apps/your_app/core.js, add: require('ext/binding');
// place this in apps/your_app/ext/binding.js:
SC.mixin(SC.Binding, {
firstObject: function() {
return this.transform(function(value, isForward) {
if (value && value.isEnumerable) {
value = value.firstObject();
}
return value;