Skip to content

Commit

Permalink
update refresh container
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislas Polu committed Apr 17, 2012
1 parent 3e74de0 commit 1842413
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
5 changes: 2 additions & 3 deletions cell-0.2.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions src/container.js
Expand Up @@ -66,19 +66,15 @@ CELL.container = function(spec, my) {

/**
* RECURSIVE FUNCTION
* Recursively refreshes the elements children. refresh should be implemented
* and `_super.refresh()` called when suited. The refresh function must be in
* charge of updating the UI with the updated json data passed recursively.
* @param data the update data to use to refresh the UI
* Recursively refreshes the children cells. refresh should be implemented
* and `_super.refresh()` called when suited. `my.json` must be set with the
* correct compatible architecture before a call to refresh
*/
refresh = function(json) {
if(typeof json !== 'undefined')
my.json = json;

refresh = function() {
for(var c in my.children) {
if(my.children.hasOwnProperty(c) &&
typeof my.json[c] !== 'undefined')
my.children[c].refresh(json[c]);
my.children[c].refresh(my.json[c]);
}
};

Expand Down

0 comments on commit 1842413

Please sign in to comment.