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

help tip can be changed in the runtime

parent ace8fd80
No related branches found
No related tags found
1 merge request!32Resolve "Help tips"
......@@ -26,29 +26,8 @@ function Panel(params) {
$(self.getElement()).css("position", "relative");
if (params.helpTip !== undefined) {
var helpTipButton = Functions.createElement({
type : "button",
style : "position: absolute; top:5px; right: 5px;width:18px",
content : '<span class="ui-icon ui-icon-help" style="margin-left: -0.5em;"/>',
});
helpTipButton.onclick = function() {
var helpDialogDiv = Functions.createElement({
type : "div",
content : params.helpTip,
});
$(helpDialogDiv).dialog({
close : function(event, ui) {
$(this).dialog('destroy').remove();
},
position : {
my : "left top",
at : "left bottom",
of : helpTipButton
},
});
$('.ui-dialog').find("a").blur();
};
self.getElement().appendChild(helpTipButton);
self.createHelpButton();
self.setHelpTip(params.helpTip);
}
GuiConnector.addWindowResizeEvent(function() {
......@@ -63,6 +42,33 @@ function Panel(params) {
Panel.prototype = Object.create(AbstractGuiElement.prototype);
Panel.prototype.constructor = Panel;
Panel.prototype.createHelpButton = function() {
var self = this;
var helpTipButton = Functions.createElement({
type : "button",
style : "position: absolute; top:5px; right: 5px;width:18px",
content : '<span class="ui-icon ui-icon-help" style="margin-left: -0.5em;"/>',
});
helpTipButton.onclick = function() {
var helpDialogDiv = Functions.createElement({
type : "div",
content : self.getHelpTip(),
});
$(helpDialogDiv).dialog({
close : function(event, ui) {
$(this).dialog('destroy').remove();
},
position : {
my : "left top",
at : "left bottom",
of : helpTipButton
},
});
$('.ui-dialog').find("a").blur();
};
self.getElement().appendChild(helpTipButton);
};
Panel.prototype.disablePanel = function(message) {
var self = this;
......@@ -447,6 +453,14 @@ Panel.prototype.getParent = function() {
return this._parent;
};
Panel.prototype.setHelpTip = function(helpTip) {
this._helpTip = helpTip;
};
Panel.prototype.getHelpTip = function() {
return this._helpTip;
};
Panel.prototype.onresize = function() {
var self = this;
var footerPosition = window.innerHeight;
......
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