MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / createButton

Function createButton

frameless-window/titlebar.js:18–32  ·  view source on GitHub ↗
(button_id, button_name, normal_image_url,
                       hover_image_url, click_func)

Source from the content-addressed store, hash-verified

16}
17
18function createButton(button_id, button_name, normal_image_url,
19 hover_image_url, click_func) {
20 var button = document.createElement("div");
21 button.setAttribute("class", button_name);
22 var button_img = createImage(button_id, normal_image_url);
23 button.appendChild(button_img);
24 button.onmouseover = function() {
25 updateImageUrl(button_id, hover_image_url);
26 }
27 button.onmouseout = function() {
28 updateImageUrl(button_id, normal_image_url);
29 }
30 button.onclick = click_func;
31 return button;
32}
33
34function focusTitlebars(focus) {
35 var bg_color = focus ? "#3a3d3d" : "#7a7c7c";

Callers 1

addTitlebarFunction · 0.85

Calls 2

createImageFunction · 0.85
updateImageUrlFunction · 0.85

Tested by

no test coverage detected