3 var data = app.ns("data");
6 data.Model = ux.Observable.extend({
11 this.set( this.config.data );
13 set: function( key, value ) {
14 if( arguments.length === 1 ) {
15 this._data = $.extend( {}, key );
17 key.split(".").reduce(function( ptr, prop, i, props) {
18 if(i === (props.length - 1) ) {
21 if( !(prop in ptr) ) {
29 get: function( key ) {
30 return key.split(".").reduce( function( ptr, prop ) {
31 return ( ptr && ( prop in ptr ) ) ? ptr[ prop ] : undefined;
35 })( this.jQuery, this.app );