mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Progress on discussion form
This commit is contained in:
parent
5dbfe3b2ea
commit
825d6545cf
@ -68,15 +68,35 @@ ComunicWeb.components.discussions.list = {
|
||||
//Create and display discussion creation form
|
||||
var createForm = createElem("div", listBox.boxBody);
|
||||
|
||||
//Choose users
|
||||
//Create select user element
|
||||
var selectElement = createFormGroup({
|
||||
target: createForm,
|
||||
label: "Users",
|
||||
multiple: true,
|
||||
placeholder: "Select users",
|
||||
type: "select2"});
|
||||
|
||||
//Initialize user selector
|
||||
ComunicWeb.components.userSelect.init(selectElement);
|
||||
|
||||
|
||||
//Discussion name
|
||||
var discussionNameInput = createFormGroup(createForm, "Discussion name", "Optionnal", "text");
|
||||
var discussionNameInput = createFormGroup({
|
||||
target: createForm,
|
||||
label: "Discussion name",
|
||||
placeholder: "Optionnal",
|
||||
type: "text"});
|
||||
|
||||
//Follow disucssion
|
||||
var followDiscussionInput = createFormGroup(createForm, "Follow discussion", "true", "checkbox");
|
||||
|
||||
var followDiscussionInput = createFormGroup({
|
||||
target: createForm,
|
||||
label: "Follow discussion",
|
||||
checked: true,
|
||||
type: "checkbox"});
|
||||
|
||||
//Create button
|
||||
var createButton = createElem("butto", createForm);
|
||||
var createButton = createElem("button", createForm);
|
||||
createButton.className = "btn btn-primary";
|
||||
createButton.style.width = "100%";
|
||||
createButton.innerHTML = "Create discussion";
|
||||
|
@ -28,21 +28,6 @@ ComunicWeb.pages.home.home = {
|
||||
loginButton.innerHTML="Logout";
|
||||
targetElement.appendChild(loginButton);
|
||||
|
||||
//Create select user element
|
||||
var formGroup = createElem("div", targetElement);
|
||||
formGroup.className = "form-group";
|
||||
var selectElement = createElem("select", formGroup);
|
||||
selectElement.className = "form-control select2";
|
||||
selectElement.setAttribute("multiple", "multiple");
|
||||
selectElement.setAttribute("data-placeholder", "Select users");
|
||||
|
||||
//Initialize user selector
|
||||
ComunicWeb.components.userSelect.init(selectElement);
|
||||
|
||||
setInterval(function(){
|
||||
console.log(ComunicWeb.components.userSelect.getResults(selectElement));
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
else{
|
||||
//Display landing page
|
||||
|
Loading…
Reference in New Issue
Block a user