* finish task #5086.

This commit is contained in:
Catouse
2018-11-15 15:19:39 +08:00
parent 52ecb55c52
commit 9fc889340f
4 changed files with 26 additions and 4 deletions
+4
View File
@@ -14,3 +14,7 @@
#zeroTaskStory > label:before {top: 7px; left: 5px;}
#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;}
+19 -1
View File
@@ -123,7 +123,24 @@ function toggleZeroTaskStory()
}
})
$select.val(selectVal).trigger("chosen:updated");
})
});
}
// see http://pms.zentao.net/task-view-5086.html
function markStoryTask()
{
$('select[name^="story"]').each(function()
{
var $select = $(this);
$select.find('option').each(function()
{
var $option = $(this);
var value = $option.attr('value');
var tasksCount = storyTasks[value];
$option.attr('data-data', tasksCount + 't').toggleClass('has-task', !!(tasksCount && tasksCount !== '0'));
});
$select.trigger("chosen:updated");
});
}
$(document).on('click', '.chosen-with-drop', function()
@@ -168,6 +185,7 @@ $(function()
$('#module0_chosen').width($('#module1_chosen').width());
$('#story0_chosen').width($('#story1_chosen').width());
if($.cookie('zeroTask') == 'true') toggleZeroTaskStory();
markStoryTask();
if(storyID != 0) setStoryRelated(0);