Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [x] to the respec-err popup which allows closing it. #83

Merged
merged 1 commit into from
Oct 4, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 23 additions & 4 deletions js/w3c/legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,33 @@ var sn;
(function () {
if (typeof(berjon) == "undefined") window.berjon = {};
function _errEl () {
var err = document.getElementById("respec-err");
if (err) return err.firstElementChild;
var id = "respec-err";
var err = document.getElementById(id);
if (err) return err.firstElementChild.nextElementSibling;
err = sn.element("div",
{ id: "respec-err",
{ id: id,
style: "position: fixed; width: 350px; top: 10px; right: 10px; border: 3px double #f00; background: #fff",
"class": "removeOnSave" },
document.body);
return sn.element("ul", {}, err);

var hide = sn.element("p", {
style: "float: right; margin: 2px",
}, err);

sn.text('[', hide);

var a = sn.element("a", {
href: "#",
}, hide, 'x');

a.onclick = function() {
document.getElementById(id).style.display = 'none';
return false;
};

sn.text(']', hide);

return sn.element("ul", { style: "clear: both"}, err);
}
function error (str) {
if (window.respecEvent) respecEvent.pub("error", str);
Expand Down