dropdown and additional fields

This commit is contained in:
Kameron Kenny 2019-06-25 07:35:42 -04:00
parent 5a62c2a656
commit f4586f06e5
3 changed files with 49 additions and 3 deletions

View File

@ -90,10 +90,11 @@ function genList(punchList, element) {
var list = '<ol id="sortable">'; var list = '<ol id="sortable">';
for (i = 0; i < listLength; i++) { for (i = 0; i < listLength; i++) {
if (punchList[i].progress.toLowerCase() === "in progress") { var style = "inProgress" } else { var style = "punch-default" }
if (punchList[i].progress.toLowerCase() === "done" && punchList[i].priority != 99999) { if (punchList[i].progress.toLowerCase() === "done" && punchList[i].priority != 99999) {
setPriority(punchList[i].uuid, 99999); setPriority(punchList[i].uuid, 99999);
} else if (punchList[i].progress.toLowerCase() != "done"){ } else if (punchList[i].progress.toLowerCase() != "done"){
list += '<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>' + punchList[i].subject + ' | ' + punchList[i].progress + '</li>'; list += '<li class="' + style + '"><div class="portlet"><div class="backlog-list-header">' + punchList[i].priority + '<div class=subject>' + punchList[i].subject + '</div></div><div class="backlog-list-content"><div style="punch-list-backlog-details">' + punchList[i].progress + '<br /> Created:' + punchList[i].cDate + '<br /> Modified: ' + punchList[i].mDate + '<br /><textarea>' + punchList[i].notes + '</textarea><br /><input onfocus="clearDefault(this)" type="text" id="tag" value="Add tag"><input onClick="addTag()" type=button value="Add" /> </div></div></div></div></li>';
} }
} }
@ -108,6 +109,8 @@ function mkSortable() {
$( function() { $( function() {
$( "#sortable" ).sortable({ $( "#sortable" ).sortable({
cancel: ".portlet-toggle",
placeholder: "portlet-placeholder ui-corner-all",
start: function(event, ui) { start: function(event, ui) {
window.sortObjectUUID = punchList[ui.item.index()].uuid; window.sortObjectUUID = punchList[ui.item.index()].uuid;
console.log(`Start Position: ${ui.item.index()}`); console.log(`Start Position: ${ui.item.index()}`);
@ -117,6 +120,18 @@ function mkSortable() {
console.log(`New Position: ${ui.item.index()}`); console.log(`New Position: ${ui.item.index()}`);
} }
}); });
$( ".portlet" )
.addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
.find( ".backlog-list-header" )
.addClass( "ui-widget-header ui-corner-all" )
.prepend( "<span class='ui-icon ui-icon-minusthick portlet-toggle'></span>");
$( ".portlet-toggle" ).on( "click", function() {
var icon = $( this );
icon.toggleClass( "ui-icon-minusthick ui-icon-plusthick" );
icon.closest( ".portlet" ).find( ".backlog-list-content" ).toggle();
});
$( "#sortable" ).disableSelection(); $( "#sortable" ).disableSelection();
} ); } );
} }

View File

@ -1,7 +1,37 @@
#sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; } #sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; } #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; color: #AAA;}
#sortable li span { position: absolute; margin-left: -1.3em; } #sortable li span { position: absolute; margin-left: -1.3em; }
.portlet {
margin: 0 1em 1em 0;
padding: 0.3em;
}
.backlog-list-header {
padding: 0.2em 0.3em;
margin-bottom: 0.1em;
position: relative;
}
.portlet-toggle {
position: absolute;
top: 50%;
right: 0;
margin-top: -8px;
}
.backlog-list-content {
display: none;
padding: 0.4em;
}
.portlet-placeholder {
border: 1px dotted black;
margin: 0 1em 1em 0;
height: 50px;
}
.punch-default { border: 0px solid #AAA; background: #000; }
.inProgress { background: /*#80ffcc;*/ #555; color: #000; }
.hide { display: none; } .hide { display: none; }
.punch-list-backlog-details {
font-size: 18px;
color: #aaa;
}
body { body {
background: #222; background: #222;
color: #AAA; } color: #AAA; }
@ -121,6 +151,7 @@ textarea {
.punches-current { .punches-current {
background: #555; } background: #555; }
.subject { .subject {
width: 89%;
float: left; float: left;
color: #FFF; color: #FFF;
font-size: 2rem; font-size: 2rem;

View File

@ -1,4 +1,4 @@
var version = "0.5.132", var version = "0.5.143",
debug = false, debug = false,
jsonUrl = "https://api.myjson.com/bins/1dodsj", jsonUrl = "https://api.myjson.com/bins/1dodsj",
showDone = false, showDone = false,