Skip to content

Commit c599f06

Browse files
committed
Display improvements
Use a div instead of a link so we no longer get the highlight when hovering over the icon. Remove the javascript hack to center the icon in place of a pure CSS solution.
1 parent 4f66808 commit c599f06

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

octoprint_wifistatus/static/css/wifistatus.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
#navbar_plugin_wifistatus_link {
1+
#navbar_plugin_wifistatus_div {
22
box-sizing: border-box;
3-
padding-bottom: 0;
43
height: auto;
54
}
65
#navbar_plugin_wifistatus svg {
76
fill: currentColor;
87
height: 1.4em;
8+
margin-bottom: 0.3em;
9+
vertical-align: middle;
910
}
1011
#navbar_plugin_wifistatus .popover {
1112
width: auto !important;
@@ -18,3 +19,6 @@
1819
width: auto !important;
1920
white-space: nowrap;
2021
}
22+
#navbar_plugin_wifistatus .popover td:last-child {
23+
padding-left: 1em;
24+
}

octoprint_wifistatus/static/js/wifistatus.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,6 @@ $(function () {
101101
self.IconSVG(svg);
102102
self.popoverContent(wfData);
103103
self.wifiData(wfData);
104-
var navbarHeight =
105-
document.getElementById("navbar_systemmenu").offsetHeight;
106-
var iconHeight = document
107-
.getElementById("navbar_plugin_wifistatus_icon")
108-
.getClientRects()[0].height;
109-
var link = document.getElementById("navbar_plugin_wifistatus_link");
110-
link.style.height = navbarHeight + "px";
111-
var topPadding = ((navbarHeight - iconHeight) / 2).toFixed();
112-
if (topPadding >= 0) {
113-
link.style.paddingTop = topPadding + "px";
114-
}
115104
};
116105
}
117106

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<a title="WiFi Status" id= "navbar_plugin_wifistatus_link" class="pull-right" href="javascript:void(0)" data-bind="popover: {placement: 'bottom', trigger: 'hover', html: true, title: 'WiFi Status', content: popoverContent}" style="position: relative;">
1+
<div id="navbar_plugin_wifistatus_div" class="pull-right navbar-text" data-bind="popover: {placement: 'bottom', trigger: 'hover', html: true, title: 'WiFi Status', content: popoverContent}">
22
<svg id="navbar_plugin_wifistatus_icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" data-bind="html: IconSVG"/>
3-
</a>
3+
</div>

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
plugin_identifier = "wifistatus"
66
plugin_package = "octoprint_{}".format(plugin_identifier)
77
plugin_name = "WiFi Status"
8-
plugin_version = "1.6.1"
8+
plugin_version = "1.7.0"
99
plugin_description = "Displays WiFi status on the navbar"
1010
plugin_author = "Manuel McLure"
1111
plugin_author_email = "manuel@mclure.org"

0 commit comments

Comments
 (0)