Sha256: 80836815a09e0bbca5127e48849fd2835f6bbe86d4e64d4d29254464c10c5cb3
Contents?: true
Size: 1.89 KB
Versions: 12
Compression:
Stored size: 1.89 KB
Contents
// ======================================================================== // SproutCore // copyright 2006-2008 Sprout Systems, Inc. // ======================================================================== require('foundation/path_module') ; /** @class SC.Page The Page object is used to store a set of views that can be lazily configured on page load. Page assumes that all of its properties are basically outlets and will try to configure them as such. @extends SC.Object */ SC.Page = SC.Object.extend( /** @scope SC.Page.prototype */ { get: function(key) { var value = this[key] ; if (value && (value instanceof Function) && (value.isOutlet)) { var ret = this.outlet(key) ; if (SC.window && !ret.parentNode) { SC.window._insertBefore(ret, null, false) ; SC.window._rebuildChildNodes(); } ret.awake() ; return ret ; } else return arguments.callee.base.apply(this,arguments) ; }, // in addition to activating bindings, calling awake on the page object // will cause any outlet properties to be loaded. awake: function() { arguments.callee.base.call(this) ; for(var key in this) { if (this.hasOwnProperty(key) && this[key] && this[key].isOutlet) { this.get(key) ; // convert to outlet. } } }, init: function() { arguments.callee.base.apply(this,arguments) ; var el = this.rootElement = $('resources') ; SC.callOnLoad(function() { if (el && el.parentNode) el.parentNode.removeChild(el) ; }) ; }, // returns the property, but only if it is already configured. getIfConfigured: function(key) { var value = this[key] ; if (value && (value instanceof Function) && (value.isOutlet)) { return null ; } else return value ; }, _insertBefore: function() {}, _rebuildChildNodes: function() {} }) ; Object.extend(SC.Page.prototype, SC.PathModule) ;
Version data entries
12 entries across 12 versions & 1 rubygems