Skip to content

Commit

Permalink
added basic version of cell and container
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Apr 18, 2012
1 parent 9087582 commit 8e8e5a1
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
42 changes: 42 additions & 0 deletions basic/basic_cell.js
@@ -0,0 +1,42 @@
/************************************/
/* BASIC CELL */
/************************************/

var basic_c = function(spec, my) {
var _super = {};
var my = my || {};

// public
var build; /* build(); */
var refresh; /* refresh(); */

// private

var that = CELL.cell(spec, my);

/**
* builds the cell static content
*/
build = function() {
// ...
};

/**
* refreshes the cell content with received data
* @expected { ... }
*/
refresh = function(json) {
// ...
_super.refresh(json);
};


CELL.method(that, 'build', build, _super);
CELL.method(that, 'refresh', refresh, _super);

return that;
};




50 changes: 50 additions & 0 deletions basic/basic_container.js
@@ -0,0 +1,50 @@
/************************************/
/* BASIC CONTAINER */
/************************************/
/**
* @param sepc {}
*/
var basic_t = function(spec, my) {
var _super = {};
var my = my || {};

// public
var load; /* load(); */
var refresh; /* refresh(); */

// private

var that = CELL.container({ name: 'basic' }, my);

/**
* loads children cells within the DOM
*/
load = function() {
var elem = $('#some_id');

// Construction
my.children['basic'] = basic_c({ path: my.path + '/basic', container: that });
elem.append(my.children['menu'].build());

// Handlers
my.children['basic'].on('some_event', function() {
// ...
});

// Start Updates
};

/**
* refreshes the UI with new version of data
*/
refresh = function() {
// ...
_super.refresh();
};


CELL.method(that, 'load', load, _super);
CELL.method(that, 'refresh', refresh, _super);

return that;
};

0 comments on commit 8e8e5a1

Please sign in to comment.