add event delegation to update after task, descriptive tip, other fixes related to empty fields
This commit is contained in:
parent
640355c696
commit
5c53b11a26
21
index.html
21
index.html
@ -1,3 +1,14 @@
|
|||||||
|
<!--
|
||||||
|
/**
|
||||||
|
* logerr
|
||||||
|
*
|
||||||
|
* @category scrum-board
|
||||||
|
* @author Vaibhav Mehta <vaibhav@decodingweb.com>
|
||||||
|
* @copyright Copyright (c) 2016 Vaibhav Mehta <https://github.com/i-break-codes>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
|
* @version 1.0 Beta
|
||||||
|
*/
|
||||||
|
-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
@ -87,7 +98,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="hide" id="tips">
|
<div class="hide" id="tips">
|
||||||
Double click on the task text to edit it
|
Double click on the task text to edit it <br> <span>(Task titles are not editable for now)</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script id="task-card-template" type="text/x-handlebars-template">
|
<script id="task-card-template" type="text/x-handlebars-template">
|
||||||
@ -97,8 +108,12 @@
|
|||||||
<h5>{{title}}</h5>
|
<h5>{{title}}</h5>
|
||||||
<div class="card-details">
|
<div class="card-details">
|
||||||
<p data-field="description">{{description}}</p>
|
<p data-field="description">{{description}}</p>
|
||||||
<p data-field="remote_url"><a href="{{#checkForBlank remote_url}}{{/checkForBlank}}" target="_blank">{{#checkForBlank remote_url}}{{/checkForBlank}}</a></p>
|
<p data-field="remote_url">
|
||||||
<p data-field="assigned_to">{{#checkForBlank assigned_to}}{{/checkForBlank}}</p>
|
{{#checkIfEmptyRemoteURL remote_url}}{{/checkIfEmptyRemoteURL}}
|
||||||
|
</p>
|
||||||
|
<p data-field="assigned_to">
|
||||||
|
{{#checkIfEmptyAssigned assigned_to}}{{/checkIfEmptyAssigned}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|||||||
@ -1,3 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* logerr
|
||||||
|
*
|
||||||
|
* @category scrum-board
|
||||||
|
* @author Vaibhav Mehta <vaibhav@decodingweb.com>
|
||||||
|
* @copyright Copyright (c) 2016 Vaibhav Mehta <https://github.com/i-break-codes>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
|
* @version 1.0 Beta
|
||||||
|
*/
|
||||||
|
|
||||||
var App = function() {
|
var App = function() {
|
||||||
function init() {
|
function init() {
|
||||||
tips();
|
tips();
|
||||||
@ -82,7 +92,7 @@ var App = function() {
|
|||||||
$(this).attr('contenteditable','true').parents('.card').addClass('edit-mode');
|
$(this).attr('contenteditable','true').parents('.card').addClass('edit-mode');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.card').find('p').on('input', function() {
|
$(document).on('input', '.card p', function() {
|
||||||
var taskId = $(this).parents('.card').data('task-id');
|
var taskId = $(this).parents('.card').data('task-id');
|
||||||
var fieldToEdit = $(this).data('field');
|
var fieldToEdit = $(this).data('field');
|
||||||
var getTaskData = JSON.parse(LocalStorage.get('task-' + taskId));
|
var getTaskData = JSON.parse(LocalStorage.get('task-' + taskId));
|
||||||
|
|||||||
@ -1,3 +1,45 @@
|
|||||||
Handlebars.registerHelper('checkForBlank', function(val, options) {
|
/**
|
||||||
return (val !== '') ? val : '-';
|
* logerr
|
||||||
});
|
*
|
||||||
|
* @category scrum-board
|
||||||
|
* @author Vaibhav Mehta <vaibhav@decodingweb.com>
|
||||||
|
* @copyright Copyright (c) 2016 Vaibhav Mehta <https://github.com/i-break-codes>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
|
* @version 1.0 Beta
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Clearup this mess later and find a better way to handle blank fields
|
||||||
|
|
||||||
|
var Helper = function() {
|
||||||
|
function init() {
|
||||||
|
checkIfEmptyRemoteURL();
|
||||||
|
checkForEmptyAssign();
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkIfEmptyRemoteURL() {
|
||||||
|
Handlebars.registerHelper('checkIfEmptyRemoteURL', function(val, options) {
|
||||||
|
if(val) {
|
||||||
|
return '<a href="' + val + '" target="_blank">' + val + '</a>';
|
||||||
|
} else {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkForEmptyAssign() {
|
||||||
|
Handlebars.registerHelper('checkIfEmptyAssigned', function(val, options) {
|
||||||
|
if(val) {
|
||||||
|
return val;
|
||||||
|
} else {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: init
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
|
||||||
|
Helper.init();
|
||||||
@ -1,3 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* logerr
|
||||||
|
*
|
||||||
|
* @category scrum-board
|
||||||
|
* @author Vaibhav Mehta <vaibhav@decodingweb.com>
|
||||||
|
* @copyright Copyright (c) 2016 Vaibhav Mehta <https://github.com/i-break-codes>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
|
* @version 1.0 Beta
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
var LocalStorage = function() {
|
var LocalStorage = function() {
|
||||||
function set(key, val) {
|
function set(key, val) {
|
||||||
localStorage.setItem(key, val);
|
localStorage.setItem(key, val);
|
||||||
|
|||||||
@ -1,3 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* logerr
|
||||||
|
*
|
||||||
|
* @category scrum-board
|
||||||
|
* @author Vaibhav Mehta <vaibhav@decodingweb.com>
|
||||||
|
* @copyright Copyright (c) 2016 Vaibhav Mehta <https://github.com/i-break-codes>
|
||||||
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
||||||
|
* @version 1.0 Beta
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
@import 'https://fonts.googleapis.com/css?family=Hind+Vadodara:300,400';
|
@import 'https://fonts.googleapis.com/css?family=Hind+Vadodara:300,400';
|
||||||
|
|
||||||
//Colors
|
//Colors
|
||||||
@ -565,10 +576,15 @@ footer {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background: {
|
background: {
|
||||||
image: url('../images/info.svg');
|
image: url('../images/info.svg');
|
||||||
position: 4px center;
|
position: 4px 12px;
|
||||||
size: 16px;
|
size: 16px;
|
||||||
repeat: no-repeat;
|
repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 10px;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes showTips {
|
@keyframes showTips {
|
||||||
|
|||||||
Reference in New Issue
Block a user