Progress on discussion form

This commit is contained in:
Pierre 2017-06-07 14:16:54 +02:00
parent 5dbfe3b2ea
commit 825d6545cf
2 changed files with 24 additions and 19 deletions

View File

@ -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";

View File

@ -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