Merge pull request #435 from ZmagoD/zd_SCI_907

fixes checklist item user popover bug [fixes SCI-907]
This commit is contained in:
Zmago Devetak 2017-01-23 17:07:44 +01:00 committed by GitHub
commit 386c379602
3 changed files with 25 additions and 3 deletions

View file

@ -79,6 +79,7 @@ function applyCancelCallBack() {
setTimeout(function() {
initStepsComments();
SmartAnnotation.preventPropagation('.atwho-user-popover');
TinyMCE.destroyAll();
}, 1000);
@ -182,6 +183,7 @@ function formCallback($form) {
setTimeout(function() {
initStepsComments();
SmartAnnotation.preventPropagation('.atwho-user-popover');
}, 1000);
return true;
});
@ -205,6 +207,7 @@ function formEditAjax($form) {
toggleButtons(true);
TinyMCE.destroyAll();
SmartAnnotation.preventPropagation('.atwho-user-popover');
// Show the edited step
$new_step.find(".panel-collapse:first").addClass("collapse in");
@ -221,6 +224,8 @@ function formEditAjax($form) {
applyCancelCallBack();
TinyMCE.refresh();
SmartAnnotation.preventPropagation('.atwho-user-popover');
//Rerender tables
$form.find("[data-role='step-hot-table']").each(function() {
renderTable($(this));
@ -247,6 +252,8 @@ function formNewAjax($form) {
TinyMCE.init();
TinyMCE.highlight();
SmartAnnotation.preventPropagation('.atwho-user-popover');
//Rerender tables
$new_step.find("div.step-result-hot-table").each(function() {
$(this).handsontable("render");
@ -264,6 +271,7 @@ function formNewAjax($form) {
formNewAjax($form);
applyCancelOnNew();
TinyMCE.destroyAll();
SmartAnnotation.preventPropagation('.atwho-user-popover');
});
}
@ -576,6 +584,7 @@ $(document).ready(function() {
setupAssetsLoading();
initStepsComments();
TinyMCE.highlight();
SmartAnnotation.preventPropagation('.atwho-user-popover');
$(function () {

View file

@ -21,6 +21,14 @@ var SmartAnnotation = (function() {
return publicApi;
})();
// stop the user annotation popover on click propagation
function atwhoStopPropagation(element) {
$(element).on('click', function(e) {
e.stopPropagation();
e.preventDefault();
});
}
function setAtWho(field) {
var FilterTypeEnum = Object.freeze({
USER: {tag: "users",
@ -422,9 +430,10 @@ var SmartAnnotation = (function() {
atWho.init();
}
var publicApi = {
init: initialize
};
var publicApi = Object.freeze({
init: initialize,
preventPropagation: atwhoStopPropagation
});
return publicApi;

View file

@ -1916,3 +1916,7 @@ th.custom-field .modal-tooltiptext {
word-wrap: break-word;
}
}
.popover-remove {
cursor: pointer;
}