Commit 8da3a307 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 cbf17acf
...@@ -150,6 +150,7 @@ var RenderJs = (function () { ...@@ -150,6 +150,7 @@ var RenderJs = (function () {
setReady(); setReady();
RenderJs.setGadgetAndRecurse(gadget, data); RenderJs.setGadgetAndRecurse(gadget, data);
RenderJs.checkAndTriggerReady(); RenderJs.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
} }
}); });
} else { } else {
...@@ -158,6 +159,7 @@ var RenderJs = (function () { ...@@ -158,6 +159,7 @@ var RenderJs = (function () {
gadget_js.setReady(); gadget_js.setReady();
this.setGadgetAndRecurse(gadget, data); this.setGadgetAndRecurse(gadget, data);
this.checkAndTriggerReady(); this.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
} }
} else { } else {
// not to be cached // not to be cached
...@@ -170,6 +172,7 @@ var RenderJs = (function () { ...@@ -170,6 +172,7 @@ var RenderJs = (function () {
setReady(); setReady();
RenderJs.setGadgetAndRecurse(gadget, data); RenderJs.setGadgetAndRecurse(gadget, data);
RenderJs.checkAndTriggerReady(); RenderJs.checkAndTriggerReady();
RenderJs.updateGadgetData(gadget);
} }
}); });
} }
...@@ -442,14 +445,14 @@ var RenderJs = (function () { ...@@ -442,14 +445,14 @@ var RenderJs = (function () {
visible_dom.removeClass("not_selected"); 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) { gadget_data_source) {
/* /*
* add new gadget and render it * add new gadget and render it
*/ */
var tab_gadget; var tab_gadget;
tab_gadget = RenderJs.addGadget( 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) // 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