Skip to content

Instantly share code, notes, and snippets.

View topherfangio's full-sized avatar

Topher Fangio topherfangio

View GitHub Profile
@publickeating
publickeating / anchor_view.js
Created May 23, 2013 19:24
A proposed SC.AnchorView addition.
// ==========================================================================
// Project: SproutCore
// Copyright: ©2012 7x7 Software, Inc.
// License: Licensed under MIT license
// ==========================================================================
/**
@class
@publickeating
publickeating / custom_view_with_internal_statechart.js
Last active December 13, 2015 17:19
A custom view that manages its state using SC.StatechartManager instead of internal flags. This is a simple view that only needs to toggle an active property when the mouse is over it. However, as simple as this requirement is, we can see that it benefits from using a statechart because the isEnabled value affects the behaviour. Imagine if there…
/**
* 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.