Commit c5ec3af4 authored by Romain Courteaud's avatar Romain Courteaud

erp5_no_style: wip

parent 093db9c1
......@@ -9,23 +9,22 @@
this.element.hidden = true;
this.main_element = this.element.querySelector('main');
})
.allowPublicAcquisition("getMainInnerHTML", function () {
return this.main_element.innerHTML;
})
.allowPublicAcquisition("showPage", function () {
this.element.hidden = false;
})
.declareService(function () {
var gadget = this,
style_gadget,
body = gadget.element;
// Clear the DOM
while (body.firstChild) {
body.firstChild.remove();
}
return gadget.declareGadget('nostyle_syna.html')
.push(function (style_gadget) {
.push(function (result) {
style_gadget = result;
return style_gadget.render(gadget.main_element.innerHTML);
})
.push(function () {
body.appendChild(style_gadget.element);
gadget.element.hidden = false;
});
});
......
......@@ -4,23 +4,12 @@
"use strict";
rJS(window)
.declareAcquiredMethod("getMainInnerHTML", "getMainInnerHTML")
.declareAcquiredMethod("showPage", "showPage")
.declareService(function () {
var gadget = this;
return gadget.getMainInnerHTML()
.push(function (main_innerhtml) {
var div = document.createElement('div');
div.innerHTML = main_innerhtml;
gadget.element.querySelector('div.py-5').innerHTML = div.querySelector('div.input').firstChild.innerHTML;
return RSVP.delay(50);
})
.push(function () {
return gadget.showPage();
});
.declareMethod("render", function (main_innerhtml) {
var gadget = this,
div = document.createElement('div');
div.innerHTML = main_innerhtml;
gadget.element.querySelector('div.py-5').innerHTML = div.querySelector('div.input').firstChild.innerHTML;
});
}());
\ 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