Commit b30668de authored by Ivan Tyagov's avatar Ivan Tyagov

Fix API inconsistency between addNewTabGadget and addGadget.

Do use "data-gadget-source" / "data-gadget-handler"  for all gadgets not
just for inline ones (without an URL).
parent b23525a0
......@@ -150,6 +150,7 @@ var RenderJs = (function () {
setReady();
RenderJs.setGadgetAndRecurse(gadget, data);
RenderJs.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
}
});
} else {
......@@ -158,6 +159,7 @@ var RenderJs = (function () {
gadget_js.setReady();
this.setGadgetAndRecurse(gadget, data);
this.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
}
} else {
// not to be cached
......@@ -170,6 +172,7 @@ var RenderJs = (function () {
setReady();
RenderJs.setGadgetAndRecurse(gadget, data);
RenderJs.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
}
});
}
......@@ -442,14 +445,14 @@ var RenderJs = (function () {
visible_dom.removeClass("not_selected");
},
addNewTabGadget: function (dom_id, gadget, gadget_data_handler,
addNewTabGadget: function (dom_id, gadget_id, gadget, gadget_data_handler,
gadget_data_source) {
/*
* add new gadget and render it
*/
var tab_gadget;
tab_gadget = RenderJs.addGadget(
dom_id, gadget, gadget_data_handler, gadget_data_source
dom_id, gadget_id, gadget, gadget_data_handler, gadget_data_source
);
// XXX: we should unregister all gadgets (if any we replace now in DOM)
}
......
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