summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Kindströmmer <me@brolaugh.com>2016-05-23 13:39:07 +0200
committerHannes Kindströmmer <me@brolaugh.com>2016-05-23 13:39:07 +0200
commit77206bbc86df48700322ec59f7ce006af34c94b5 (patch)
tree3cb9c7f83863ac6e8eb4f126f73cfc2318d78897
parent6397948d18f95412cf626f1bb469b446f3b58dda (diff)
downloadtasklist-php-origin/HEAD.zip
tasklist-php-origin/HEAD.tar.gz
tasklist-php-origin/HEAD.tar.bz2
Fixed filter for when task changes to statusHEADorigin/masterorigin/HEADmaster
Fixed filter for when task changes to status to one that is hidden via the filter.
-rw-r--r--App/pages/dashboard.php8
-rw-r--r--js/master.js18
2 files changed, 15 insertions, 11 deletions
diff --git a/App/pages/dashboard.php b/App/pages/dashboard.php
index 31aafc4..e4420eb 100644
--- a/App/pages/dashboard.php
+++ b/App/pages/dashboard.php
@@ -45,20 +45,20 @@
<form class="form-horizontal" action="javascript:addTask()" method="post">
<fieldset>
<div class="form-group">
- <label for="tasktitle" class="control-label col-md-2">Uppgift</label>
+ <label for="tasktitle" class="control-label col-md-2 text-primary">Uppgift</label>
<div class="col-md-10">
<input type="text" name="tasktitle" id="tasktitle" placeholder="Uppgiftstitel" class="form-control" required="required">
</div>
</div>
<div class="form-group">
- <label for="taskbody" class="control-label col-md-2">Detalj</label>
+ <label for="taskbody" class="control-label col-md-2 text-primary">Detalj</label>
<div class="col-md-10">
- <textarea name="taskbody" id="taskbody" rows="5" class="col-md-10 col-sm-10 col-xs-12 form-control"
+ <textarea name="taskbody" id="taskbody" rows="2" style="height: auto" class="col-md-10 col-sm-10 col-xs-12 form-control"
placeholder="Detaljer"></textarea>
</div>
</div>
<div class="form-group">
- <label for="person" class="control-label col-md-2">Person</label>
+ <label for="person" class="control-label col-md-2 text-primary">Person</label>
<div class="col-md-10">
<input type="text" name="taskperson" id="taskperson" placeholder="Person" class="form-control" required="required">
</div>
diff --git a/js/master.js b/js/master.js
index e5a0ba3..d08454d 100644
--- a/js/master.js
+++ b/js/master.js
@@ -1,4 +1,5 @@
var title, status, task;
+var statusClasses = ['added','indev', 'done','prio1'];
function modalFix(task_s, status_s, title_s){
document.getElementById("modal-title").value = title_s;
title = title_s;
@@ -6,7 +7,6 @@ function modalFix(task_s, status_s, title_s){
status = status_s;
document.getElementById("modaltask").value = task_s;
task = task_s;
- console.log("modalFix");
}
function addTask(){
@@ -42,7 +42,6 @@ function getLastTask(){
function changeStatus(){
var xmlhttp = new XMLHttpRequest();
var user = document.getElementById("modalname").value;
- console.debug(user);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
$('#statusmodal').modal('hide');
@@ -58,19 +57,24 @@ function UpdateTaskVisuals(taskID){
var user = document.getElementById("modalname").value;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- document.getElementById("task_nr_"+taskID).innerHTML = xmlhttp.responseText;
+ var taskNr = document.getElementById("task_nr_"+taskID);
+ taskNr.innerHTML = xmlhttp.responseText;
+ taskNr.classList.remove(taskNr.classList.item(taskNr.classList.length-1));
+ taskNr.classList.add("status-"+statusClasses[status-1]);
+ if(document.getElementById(statusClasses[status-1]).checked){
+ $("#"+taskNr.id).show();
+ }
+ else{
+ $("#"+taskNr.id).hide();
+ }
}
};
xmlhttp.open("POST", "App/ajax/gettask_inner.php", true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.send("task="+taskID);
}
-function getStatusHistory(task){
-
-}
function applyFilter(object){
- console.log(object.checked);
if(!object.checked)
$(".status-"+object.id).hide();
else {