Skip to content

Commit fe14a87

Browse files
committed
have reset control match other control styles
1 parent 6427fed commit fe14a87

File tree

4 files changed

+8
-128
lines changed

4 files changed

+8
-128
lines changed

inst/htmlwidgets/mapboxgl.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,22 +2033,7 @@ HTMLWidgets.widget({
20332033
resetControl.type = "button";
20342034
resetControl.setAttribute("aria-label", "Reset");
20352035
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
2036-
resetControl.style.backgroundColor = "white";
2037-
resetControl.style.border = "none";
2038-
resetControl.style.cursor = "pointer";
2039-
resetControl.style.padding = "0";
2040-
resetControl.style.width = "30px";
2041-
resetControl.style.height = "30px";
2042-
resetControl.style.display = "flex";
2043-
resetControl.style.justifyContent = "center";
2044-
resetControl.style.alignItems = "center";
2045-
resetControl.style.transition = "background-color 0.2s";
2046-
resetControl.addEventListener("mouseover", function () {
2047-
this.style.backgroundColor = "#f0f0f0";
2048-
});
2049-
resetControl.addEventListener("mouseout", function () {
2050-
this.style.backgroundColor = "white";
2051-
});
2036+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
20522037

20532038
const resetContainer = document.createElement("div");
20542039
resetContainer.className = "mapboxgl-ctrl mapboxgl-ctrl-group";
@@ -3507,22 +3492,7 @@ if (HTMLWidgets.shinyMode) {
35073492
resetControl.type = "button";
35083493
resetControl.setAttribute("aria-label", "Reset");
35093494
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
3510-
resetControl.style.backgroundColor = "white";
3511-
resetControl.style.border = "none";
3512-
resetControl.style.cursor = "pointer";
3513-
resetControl.style.padding = "0";
3514-
resetControl.style.width = "30px";
3515-
resetControl.style.height = "30px";
3516-
resetControl.style.display = "flex";
3517-
resetControl.style.justifyContent = "center";
3518-
resetControl.style.alignItems = "center";
3519-
resetControl.style.transition = "background-color 0.2s";
3520-
resetControl.addEventListener("mouseover", function () {
3521-
this.style.backgroundColor = "#f0f0f0";
3522-
});
3523-
resetControl.addEventListener("mouseout", function () {
3524-
this.style.backgroundColor = "white";
3525-
});
3495+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
35263496

35273497
const resetContainer = document.createElement("div");
35283498
resetContainer.className = "mapboxgl-ctrl mapboxgl-ctrl-group";

inst/htmlwidgets/mapboxgl_compare.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,22 +1288,7 @@ HTMLWidgets.widget({
12881288
resetControl.type = "button";
12891289
resetControl.setAttribute("aria-label", "Reset");
12901290
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
1291-
resetControl.style.backgroundColor = "white";
1292-
resetControl.style.border = "none";
1293-
resetControl.style.cursor = "pointer";
1294-
resetControl.style.padding = "0";
1295-
resetControl.style.width = "30px";
1296-
resetControl.style.height = "30px";
1297-
resetControl.style.display = "flex";
1298-
resetControl.style.justifyContent = "center";
1299-
resetControl.style.alignItems = "center";
1300-
resetControl.style.transition = "background-color 0.2s";
1301-
resetControl.addEventListener("mouseover", function () {
1302-
this.style.backgroundColor = "#f0f0f0";
1303-
});
1304-
resetControl.addEventListener("mouseout", function () {
1305-
this.style.backgroundColor = "white";
1306-
});
1291+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
13071292

13081293
const resetContainer = document.createElement("div");
13091294
resetContainer.className = "mapboxgl-ctrl mapboxgl-ctrl-group";
@@ -3152,22 +3137,7 @@ HTMLWidgets.widget({
31523137
resetControl.type = "button";
31533138
resetControl.setAttribute("aria-label", "Reset");
31543139
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
3155-
resetControl.style.backgroundColor = "white";
3156-
resetControl.style.border = "none";
3157-
resetControl.style.cursor = "pointer";
3158-
resetControl.style.padding = "0";
3159-
resetControl.style.width = "30px";
3160-
resetControl.style.height = "30px";
3161-
resetControl.style.display = "flex";
3162-
resetControl.style.justifyContent = "center";
3163-
resetControl.style.alignItems = "center";
3164-
resetControl.style.transition = "background-color 0.2s";
3165-
resetControl.addEventListener("mouseover", function () {
3166-
this.style.backgroundColor = "#f0f0f0";
3167-
});
3168-
resetControl.addEventListener("mouseout", function () {
3169-
this.style.backgroundColor = "white";
3170-
});
3140+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
31713141

31723142
const resetContainer = document.createElement("div");
31733143
resetContainer.className = "mapboxgl-ctrl mapboxgl-ctrl-group";

inst/htmlwidgets/maplibregl.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,22 +2122,7 @@ HTMLWidgets.widget({
21222122
resetControl.type = "button";
21232123
resetControl.setAttribute("aria-label", "Reset");
21242124
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
2125-
resetControl.style.backgroundColor = "white";
2126-
resetControl.style.border = "none";
2127-
resetControl.style.cursor = "pointer";
2128-
resetControl.style.padding = "0";
2129-
resetControl.style.width = "30px";
2130-
resetControl.style.height = "30px";
2131-
resetControl.style.display = "flex";
2132-
resetControl.style.justifyContent = "center";
2133-
resetControl.style.alignItems = "center";
2134-
resetControl.style.transition = "background-color 0.2s";
2135-
resetControl.addEventListener("mouseover", function () {
2136-
this.style.backgroundColor = "#f0f0f0";
2137-
});
2138-
resetControl.addEventListener("mouseout", function () {
2139-
this.style.backgroundColor = "white";
2140-
});
2125+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
21412126

21422127
const resetContainer = document.createElement("div");
21432128
resetContainer.className = "maplibregl-ctrl maplibregl-ctrl-group";
@@ -4990,22 +4975,7 @@ if (HTMLWidgets.shinyMode) {
49904975
resetControl.type = "button";
49914976
resetControl.setAttribute("aria-label", "Reset");
49924977
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
4993-
resetControl.style.backgroundColor = "white";
4994-
resetControl.style.border = "none";
4995-
resetControl.style.cursor = "pointer";
4996-
resetControl.style.padding = "0";
4997-
resetControl.style.width = "30px";
4998-
resetControl.style.height = "30px";
4999-
resetControl.style.display = "flex";
5000-
resetControl.style.justifyContent = "center";
5001-
resetControl.style.alignItems = "center";
5002-
resetControl.style.transition = "background-color 0.2s";
5003-
resetControl.addEventListener("mouseover", function () {
5004-
this.style.backgroundColor = "#f0f0f0";
5005-
});
5006-
resetControl.addEventListener("mouseout", function () {
5007-
this.style.backgroundColor = "white";
5008-
});
4978+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
50094979

50104980
const resetContainer = document.createElement("div");
50114981
resetContainer.className = "maplibregl-ctrl maplibregl-ctrl-group";

inst/htmlwidgets/maplibregl_compare.js

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,22 +1724,7 @@ HTMLWidgets.widget({
17241724
resetControl.type = "button";
17251725
resetControl.setAttribute("aria-label", "Reset");
17261726
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
1727-
resetControl.style.backgroundColor = "white";
1728-
resetControl.style.border = "none";
1729-
resetControl.style.cursor = "pointer";
1730-
resetControl.style.padding = "0";
1731-
resetControl.style.width = "30px";
1732-
resetControl.style.height = "30px";
1733-
resetControl.style.display = "flex";
1734-
resetControl.style.justifyContent = "center";
1735-
resetControl.style.alignItems = "center";
1736-
resetControl.style.transition = "background-color 0.2s";
1737-
resetControl.addEventListener("mouseover", function () {
1738-
this.style.backgroundColor = "#f0f0f0";
1739-
});
1740-
resetControl.addEventListener("mouseout", function () {
1741-
this.style.backgroundColor = "white";
1742-
});
1727+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
17431728

17441729
const resetContainer = document.createElement("div");
17451730
resetContainer.className =
@@ -4043,22 +4028,7 @@ HTMLWidgets.widget({
40434028
resetControl.type = "button";
40444029
resetControl.setAttribute("aria-label", "Reset");
40454030
resetControl.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>';
4046-
resetControl.style.backgroundColor = "white";
4047-
resetControl.style.border = "none";
4048-
resetControl.style.cursor = "pointer";
4049-
resetControl.style.padding = "0";
4050-
resetControl.style.width = "30px";
4051-
resetControl.style.height = "30px";
4052-
resetControl.style.display = "flex";
4053-
resetControl.style.justifyContent = "center";
4054-
resetControl.style.alignItems = "center";
4055-
resetControl.style.transition = "background-color 0.2s";
4056-
resetControl.addEventListener("mouseover", function () {
4057-
this.style.backgroundColor = "#f0f0f0";
4058-
});
4059-
resetControl.addEventListener("mouseout", function () {
4060-
this.style.backgroundColor = "white";
4061-
});
4031+
resetControl.style.cssText = "display:flex;justify-content:center;align-items:center;cursor:pointer;";
40624032

40634033
const resetContainer = document.createElement("div");
40644034
resetContainer.className = "maplibregl-ctrl maplibregl-ctrl-group";

0 commit comments

Comments
 (0)