diff --git a/module/task/css/batchcreate.css b/module/task/css/batchcreate.css index f21a398f0b..fc1e1553c7 100644 --- a/module/task/css/batchcreate.css +++ b/module/task/css/batchcreate.css @@ -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;} \ No newline at end of file +.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;} \ No newline at end of file diff --git a/module/task/js/batchcreate.js b/module/task/js/batchcreate.js index 73be4b9f93..906da94e8a 100755 --- a/module/task/js/batchcreate.js +++ b/module/task/js/batchcreate.js @@ -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()