Commit 41b9dcf2 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_renderjs_ui: Implement pagehelp gadget

parent b8a5f439
.pagehelp {
background-color: #ffffd5;
}
p.pagehelp {
display: none;
}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Pagehelp</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_pagehelp.js" type="text/javascript"></script>
<link href="gadget_pagehelp.css" rel="stylesheet">
</head>
<body>
<div class="ui-btn ui-btn-icon-left ui-icon-info pagehelp">
<p class="pagehelp">Page help placeholder.</p>
</div>
</body>
</html>
(function (window, rJS) {
rJS(window)
.onStateChange(function (modification_dict) {
if (modification_dict.hasOwnProperty('helptext')) {
var x = this.element.getElementsByTagName("P")[0];
x.innerText = modification_dict.helptext.trim();
}
})
.onEvent('click', function (evt) {
var x = this.element.getElementsByTagName("P")[0];
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}, false, false);
}(window, rJS));
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment