Skip to content
Snippets Groups Projects
Commit d6fcd37a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '283-clicking-on-hint' into 'devel_12.1.x'

Resolve "clicking on hint in left panel"

See merge request piotr.gawron/minerva!296
parents 9951c6f3 c4d31b70
No related branches found
No related tags found
1 merge request!296Resolve "clicking on hint in left panel"
Pipeline #
......@@ -674,23 +674,27 @@ GuiUtils.prototype.createHelpButton = function (toolTip, useXss) {
content: '<span class="ui-icon ui-icon-help" style="margin-left: -0.5em;"/>',
xss: false
});
var helpDialogDiv = undefined;
helpTipButton.onclick = function () {
var helpDialogDiv = Functions.createElement({
type: "div",
content: helpContent,
xss: false
});
$(helpDialogDiv).dialog({
close: function () {
$(this).dialog('destroy').remove();
},
position: {
my: "left top",
at: "left bottom",
of: helpTipButton
}
});
$('.ui-dialog').find("a").blur();
if (helpDialogDiv === undefined) {
helpDialogDiv = Functions.createElement({
type: "div",
content: helpContent,
xss: false
});
$(helpDialogDiv).dialog({
close: function () {
$(this).dialog('destroy').remove();
helpDialogDiv = undefined;
},
position: {
my: "left top",
at: "left bottom",
of: helpTipButton
}
});
$('.ui-dialog').find("a").blur();
}
};
return helpTipButton;
};
......
......@@ -195,11 +195,25 @@ describe('GuiUtils', function () {
});
});
it('createHelpButton', function () {
var guiUtils = new GuiUtils(helper.getConfiguration());
var button = guiUtils.createHelpButton("test tooltip");
button.onclick();
$(".ui-dialog-titlebar-close").click();
describe('createHelpButton', function () {
it('default', function () {
var guiUtils = new GuiUtils(helper.getConfiguration());
var button = guiUtils.createHelpButton("test tooltip");
button.onclick();
$(".ui-dialog-titlebar-close").click();
});
it('click twice', function () {
var guiUtils = new GuiUtils(helper.getConfiguration());
var button = guiUtils.createHelpButton("test tooltip");
button.onclick();
// noinspection JSJQueryEfficiency
var counts = $("div").length;
button.onclick();
// noinspection JSJQueryEfficiency
var counts2 = $("div").length;
assert.equal(counts, counts2);
$(".ui-dialog-titlebar-close").click();
});
});
describe('createAnnotationList', function () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment