* code for task #5086.

This commit is contained in:
Catouse
2018-11-20 08:59:00 +08:00
parent e576594489
commit e87f44e6af
2 changed files with 31 additions and 4 deletions
+6 -3
View File
@@ -15,6 +15,9 @@
#zeroTaskStory > label:after {top: 5px; left: 5px;}
#zeroTaskStory.checked {border-color: #00a9fc; background: #E9F2FB;}
.chosen-results > li.has-task {position: relative;}
.chosen-results > li.has-task:before {content: attr(data-data); display: inline-block; background: rgba(0,0,0,.1); font-size: 12px; border-radius: 4px; padding: 0 4px; margin-right: 4px; position: relative; top: -1px; color: green}
.chosen-results > li.has-task.highlighted:before {color: #fff;}
.chosen-results > li.has-task {position: relative; color: #388E3C}
.chosen-results > li.has-new-task {position: relative; color: #388E3C; position: relative;}
.chosen-results > li.has-new-task:before {content: ' '; display: block; background: #4CAF50; position: absolute; left: 2px; top: 11px; width: 4px; height: 4px; border-radius: 50%;}
.chosen-results > li.has-task.highlighted,
.chosen-results > li.has-new-task.highlighted {color: #fff;}
.chosen-results > li.has-new-task.highlighted:before {background: #fff;}
+25 -1
View File
@@ -137,10 +137,34 @@ function markStoryTask()
var $option = $(this);
var value = $option.attr('value');
var tasksCount = storyTasks[value];
$option.attr('data-data', tasksCount + 't').toggleClass('has-task', !!(tasksCount && tasksCount !== '0'));
$option.attr('data-data', value).toggleClass('has-task', !!(tasksCount && tasksCount !== '0'));
});
$select.trigger("chosen:updated");
});
var getStoriesHasTask = function()
{
var storiesHasTask = {};
$('#tableBody tbody>tr').each(function()
{
var $tr = $(this);
if ($tr.find('input[name^="name"]').val())
{
storiesHasTask[$tr.find('select[name^="story"]').val()] = true;
}
});
return storiesHasTask;
};
$('#batchCreateForm').on('chosen:showing_dropdown', 'select[name^="story"]', function()
{
var storiesHasTask = getStoriesHasTask();
$(this).next('.chosen-container').find('.chosen-results>li').each(function()
{
var $li = $(this);
$li.toggleClass('has-new-task', !!storiesHasTask[$li.data('data')]);
});
});
}
$(document).on('click', '.chosen-with-drop', function()