Sha256: 5e9628328e6fce20721e8496e90c08f973e7b4abfed234a3ff55c5e96655f554
Contents?: true
Size: 1.23 KB
Versions: 17
Compression:
Stored size: 1.23 KB
Contents
// ========================================================================== // Project: SproutCore - JavaScript Application Framework // Copyright: ©2008-2011 Apple Inc. All rights reserved. // License: Licensed under MIT license (see license.js) // ========================================================================== /** Handles propagation of a property inEditMode to all child views. */ SC.FormsEditMode = { /** Walks like a duck. */ hasEditMode: YES, /** Whether we are in edit mode. */ isEditing: NO, /** Handles changes to edit state. Alerts children. */ editModeDidChange: function(){ this._propagateEditMode(); }.observes("isEditing"), /** Ensures that edit mode is passed to all children. */ _scfem_childViewsDidChange: function() { this._propagateEditMode(); }.observes("childViews"), /** Propagates edit mode. */ _propagateEditMode: function() { var isEditing = this.get("isEditing"); var cv = this.get("childViews"), idx, len = cv.length, v; for (idx = 0; idx < len; idx++) { v = cv[idx]; if (SC.typeOf(v) === SC.T_STRING || v.isClass) return; if (v.get("hasEditMode")) v.set("isEditing", isEditing); } } };
Version data entries
17 entries across 17 versions & 1 rubygems