Minor display fixes, and removed useless code

This commit is contained in:
Kenneth Jao 2016-08-09 14:49:43 -04:00
parent 3e7d6fec7c
commit 76e0701f71
2 changed files with 12 additions and 5 deletions

View File

@ -57,13 +57,13 @@
{{> inputAutocomplete settings=schoolcomplete class="form-control creInput" type="text" name="school" placeholder="Example: International Academy" }}
<p class="input">Hour:</p><br>
<input class="creInput" type="text" name="hour"><br>
<p class="input">Teacher</p>:<br>
<p class="input">Teacher:</p><br>
<input class="creInput" type="text" name="teacher"><br>
<p class="input">Class Name:</p><br>
<input class="creInput" type="text" name="classname"><br>
<p class="input">Privacy:</p><br>
<div class="select">
<input class="creInput creInputSel" type = "text" name="privacy" readonly><br>
<input class="creInputSel creInput" type="text" name="privacy" op="0" readonly><br>
<div class="creOptions" style="background-color:{{divColor 'header'}}">
<p>Public</p>
<p>Private</p>
@ -71,7 +71,7 @@
</div>
<p class="input">Category:</p><br>
<div class="select">
<input class="creInput creInputSel" type="text" name="category" readonly><br>
<input class="creInputSel creInput" type="text" name="category" op="1" readonly><br>
<div class="creOptions" style="background-color:{{divColor 'header'}}">
<p>Class</p>
<p>Club</p>

View File

@ -1,5 +1,4 @@
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import './main.html';
@ -21,7 +20,6 @@ var themeColors = {
};
var options = {
"school": [],
"privacy": ["Public", "Hidden"],
"category": ["Class", "Club", "Other"]
}
@ -34,6 +32,7 @@ Session.set("mode",null); // Change to user preferences
Session.set("function", null);
Session.set("confirm",null);
Session.set("formCre",null);
Session.set("inputOpen",null);
Cookie.set("theme","light",{'years':15});
@ -182,12 +181,20 @@ Template.main.events({
}, 300);
},
'click .creInput' (event) {
var opened = Session.get("inputOpen");
if(opened !== null && opened !== event.target.getAttribute("op")) {
closeDivFade(document.getElementsByClassName("creInputSel")[opened].parentNode.childNodes[4]);
}
},
'click .creInputSel' (event) {
Session.set("inputOpen", event.target.getAttribute("op"));
openDivFade(event.target.parentNode.childNodes[4]);
},
'click .creOptions p' (event) {
var p = event.target;
p.parentNode.parentNode.childNodes[1].value = p.childNodes[0].nodeValue;
closeDivFade(p.parentNode);
Session.set("inputOpen",null)
}
});