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

View file

@ -21,6 +21,14 @@ var SmartAnnotation = (function() {
return publicApi; 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) { function setAtWho(field) {
var FilterTypeEnum = Object.freeze({ var FilterTypeEnum = Object.freeze({
USER: {tag: "users", USER: {tag: "users",
@ -422,9 +430,10 @@ var SmartAnnotation = (function() {
atWho.init(); atWho.init();
} }
var publicApi = { var publicApi = Object.freeze({
init: initialize init: initialize,
}; preventPropagation: atwhoStopPropagation
});
return publicApi; return publicApi;

View file

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