Commit eebfc455 authored by Ivan Tyagov's avatar Ivan Tyagov

Remove logging. Add back tabbular gadget test.

parent 264ca7e3
......@@ -63,13 +63,11 @@ var RenderJs = (function () {
app_cache = RenderJs.Cache.get(cache_id, undefined);
if(app_cache===undefined || app_cache===null){
// not in cache so we pull from network and cache
//console.log("not in cache: " + cache_id + " " + url);
$.ajax({url:url,
yourCustomData: {"gadget_id": gadget_id, "cache_id": cache_id},
success: function (data) {
cache_id = this.yourCustomData.cache_id;
gadget_id = this.yourCustomData.gadget_id;
//console.log("set in cache: " + cache_id);
RenderJs.Cache.set(cache_id, data);
RenderJs.GadgetIndex.getGadgetById(gadget_id).setReady();
RenderJs.updateAndRecurse(gadget, data);
......@@ -86,7 +84,6 @@ var RenderJs = (function () {
}
else {
// not to be cached
//console.log("Not to be cached " + url + gadget_id);
$.ajax({url:url,
yourCustomData: {"gadget_id": gadget_id},
success: function (data) {
......@@ -125,9 +122,7 @@ var RenderJs = (function () {
var is_gadget_list_loaded;
is_gadget_list_loaded = RenderJs.GadgetIndex.isGadgetListLoaded();
if (is_gadget_list_loaded){
//console.log("to trigger ");
if (!RenderJs.isReady()) {
//console.log("trigger ", RenderJs.GadgetIndex.getGadgetList());
RenderJs.GadgetIndex.getRootGadget().getDom().trigger("ready");
RenderJs.setReady(true);
}
......@@ -445,7 +440,6 @@ var RenderJs = (function () {
func = new Function(func_body);
source_gadget.dom.bind(source_method_id, func);
}
console.log(source_gadget_id, '.', source_method_id, '-->', destination_gadget_id, '.', destination_method_id);
}
);
}
......
function setupRenderJSTest(){
/*
* Main RenderJS test entry point
......@@ -11,13 +13,12 @@ function setupRenderJSTest(){
});
// module("TabularGadget");
// test('addNewTabGadget', function(){
// RenderJs.TabbularGadget.addNewTabGadget("qunit-fixture", "Person_view/Form_asRenderJSGadget", "ERP5Form.update", "Form_asJSON?form_id=Person_view");
// equal($("#qunit-fixture").children(".gadget").length, 1);
// equal(RenderJs.GadgetIndex.getGadgetList().length, 1);
//
// });
module("TabularGadget");
test('addNewTabGadget', function(){
RenderJs.TabbularGadget.addNewTabGadget("qunit-fixture", "test-gadget.xhtml");
equal($("#qunit-fixture").children(".gadget").length, 1);
equal(RenderJs.GadgetIndex.getGadgetList().length, 1);
});
module("GadgetIndex");
test('GadgetIndex', function(){
......@@ -26,7 +27,7 @@ function setupRenderJSTest(){
RenderJs.GadgetIndex.unregisterGadget(this);
});
$("#qunit-fixture").append('<div gadget="" id="new">XXXXXXXXXXXX</div>');
$("#qunit-fixture").append('<div data-gadget="" id="new">XXXXXXXXXXXX</div>');
RenderJs.bootstrap($("#qunit-fixture"));
RenderJs.GadgetIndex.getRootGadget().getDom().one("ready", function (){
RenderJs.update($("#qunit-fixture"));
......
test!!!
<div id="test-container">
</div>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment