diff --git a/war/src/main/webapp/scripts/hudson-behavior.js b/war/src/main/webapp/scripts/hudson-behavior.js index dc0a38ea4ac426a50775915802e405cf8f64deda..7642d6bfeb83c4e8fc504c7febab7be34aec5994 100644 --- a/war/src/main/webapp/scripts/hudson-behavior.js +++ b/war/src/main/webapp/scripts/hudson-behavior.js @@ -3048,6 +3048,8 @@ var notificationBar = { this.div.onclick = function() { self.hide(); }; + } else { + this.div.innerHTML = ""; } }, // cancel pending auto-hide timeout @@ -3066,7 +3068,19 @@ var notificationBar = { show : function (text,options) { options = options || {}; this.init(); - this.div.innerHTML = "
"+text+""; + var icon = this.div.appendChild(document.createElement("div")); + icon.style.display = "inline-block"; + if (options.iconColor || this.defaultIconColor) { + icon.style.color = options.iconColor || this.defaultIconColor; + } + var svg = icon.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.setAttribute("viewBox", "0 0 24 24"); + svg.setAttribute("focusable", "false"); + svg.setAttribute("class", "svg-icon"); + var use = svg.appendChild(document.createElementNS("http://www.w3.org/2000/svg","use")); + use.setAttribute("href", rootURL + "/images/material-icons/" + (options.icon || this.defaultIcon)); + var message = this.div.appendChild(document.createElement("span")); + message.appendChild(document.createTextNode(text)); this.div.className=options.alertClass || this.defaultAlertClass; this.div.classList.add("notif-alert-show");