Skip to content
Snippets Groups Projects
Commit f1e03f14 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

ugly js

parent 0b62bcdb
No related branches found
No related tags found
No related merge requests found
......@@ -44,13 +44,22 @@ window.osuny.contentEditor = {
var tab = event.target,
id = tab.getAttribute('data-bs-target'),
div = this.container.querySelector(id),
source = div.dataset.source,
target = this.container.querySelector(div.dataset.target),
request;
// target.innerHTML = '';
// console.log(source);
// console.log(target);
// TODO load
source = div.dataset.source;
this.target = this.container.querySelector(div.dataset.target);
this.target.innerHTML = '';
this.xhr = new XMLHttpRequest();
this.xhr.open('GET', source, true);
this.xhr.onreadystatechange = this.tabLoaded.bind(this);
this.xhr.send();
},
tabLoaded: function (event) {
if (this.xhr.readyState === XMLHttpRequest.DONE) {
if (this.xhr.status === 200) {
this.target.innerHTML = this.xhr.responseText;
this.initSortable();
}
}
},
onSortableEnd: function (event) {
......
......@@ -48,9 +48,7 @@ mode_expert = about.headings.many?
</div>
</div>
<% end %>
<div id="mode-write-container">
<%= render 'admin/communication/contents/write', about: about %>
</div>
<div id="mode-write-container"></div>
</div>
<div class="tab-pane fade"
id="mode-structure"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment