You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a javascript code for dynamicly creating quill editors. First the toolbar buttons were not working at all. So i copied the "ql-toolbar"-div from a single created editor and build the html code before creating an editor. Now most buttons are working except for color, font, background color and link. Can anybody help me to get the buttons to work? And sorry for my bad english.
Here is my js code:
var toolbarhtml = //Here is the html code of the ql-toolbar div
function CreateBoxes(Amount, Editable, BoolToolbar) {
var box = document.getElementById("controlAddIn");
box.innerHTML += "<div id="wrapper">";
var wrapper = document.getElementById("wrapper");
for (var i = 0; i < Amount; i++) {
var editor = "editor" + (i + 1);
var header = "heading" + (i + 1);
wrapper.innerHTML += "<div class="wrapped" id="div" + (i + 1) + ""><h2 class="navHeader2" id="" + header + "">";
var div = document.getElementById("div" + (i + 1));
var preScript = "<div class="editors" id="" + editor + "">";
var postScript = ""
var fullScript = preScript + "" + postScript;
if(BoolToolbar){
div.innerHTML += toolbarhtml;
}
div.innerHTML += fullScript;
wrapper.innerHTML += "";
}
box.innerHTML += "";
var divs = document.getElementsByClassName("editors");
if(BoolToolbar){
var toolbars = document.getElementsByClassName("ql-toolbar");
var custombuttons = document.getElementsByClassName("customspan");
}
for(var j = 0; j < divs.length; j++){
var quill;
if(BoolToolbar){
//custombuttons[j].innerHTML += "<button class=\"custombutton\" onclick=\"text(" + (j + 1) + ")\">T</button>";
//ignore the line above, thats just for my custom button, which is working fine
quill = new Quill(divs[j], {
modules: {
toolbar: toolbars[j]
},
theme: 'snow'
});
} else {
quill = new Quill(divs[j], {
modules: {
},
theme: 'bubble'
});
}
if(!Editable){
quill.disable();
}
}
}
P.S.: If you need the html code from the var toolbar, tell me. But be warned, its very very long and confusing.
The text was updated successfully, but these errors were encountered:
I wrote a javascript code for dynamicly creating quill editors. First the toolbar buttons were not working at all. So i copied the "ql-toolbar"-div from a single created editor and build the html code before creating an editor. Now most buttons are working except for color, font, background color and link. Can anybody help me to get the buttons to work? And sorry for my bad english.
Here is my js code:
var toolbarhtml = //Here is the html code of the ql-toolbar div
function CreateBoxes(Amount, Editable, BoolToolbar) {
var box = document.getElementById("controlAddIn");
box.innerHTML += "<div id="wrapper">";
var wrapper = document.getElementById("wrapper");
for (var i = 0; i < Amount; i++) {
var editor = "editor" + (i + 1);
var header = "heading" + (i + 1);
wrapper.innerHTML += "<div class="wrapped" id="div" + (i + 1) + ""><h2 class="navHeader2" id="" + header + "">";
var div = document.getElementById("div" + (i + 1));
var preScript = "<div class="editors" id="" + editor + "">";
var postScript = ""
var fullScript = preScript + "" + postScript;
if(BoolToolbar){
div.innerHTML += toolbarhtml;
}
div.innerHTML += fullScript;
wrapper.innerHTML += "";
}
box.innerHTML += "";
var divs = document.getElementsByClassName("editors");
if(BoolToolbar){
var toolbars = document.getElementsByClassName("ql-toolbar");
var custombuttons = document.getElementsByClassName("customspan");
}
}
P.S.: If you need the html code from the var toolbar, tell me. But be warned, its very very long and confusing.
The text was updated successfully, but these errors were encountered: