fewieden/MMM-ip

Removing extra lines in module

Opened this issue · 3 comments

I only want display the wlan0, but the text seems to be offset as if the Eth0 lines are still present. How can I have the module height be only one line high?

The attached screen shot shows the module with a border, showing how the wlan0 info is below/outside of the box. The box is 80px high, for reference:

image

@JasonB2018 I tried to reproduce your issue. I made sure that the clock module and MMM-ip are both in the same region top_left.

image

The space that you can see between the modules is 30px and is caused by this CSS rule that applies to all modules.

Are you sure the box is coming from this module and not from having modules in different regions?

Thank you for responding and helping me with my question. My apologies for miscommunicating. I added the border to help our conversation.

The following screen grab is from a window in which MMM-IP is the only module installed:
image

The module code follows. It's indented in the code, but doesn't reflect as such on this page:
{
module: 'MMM-ip',
position: 'top_right',
config: {
families: ['IPv4'],
types: ['wlan0'],
fontSize: '20',
updateInterval: '300000',
},
},

The custom css is:
.MMM-ip {
border: solid;
height: 40px;
// top: 15%;
}

This is the only module on the page, so I can't understand why the text would be pushed down. It seems like there are several blank lines above the wlan0 line, pushing the wlan0 line down.

Thoughts?

@JasonB2018 your font size was specified as a string. The computed line-height of the module was adding 2 pixels to the font size. In Javascript, if you add a string with a number the number gets casted to a string and then the two strings get concatenated.

20 + 2 => 22

In case of your string '20' + 2 => '202'

{
	module: 'MMM-ip',
	position: 'top_right',
	config: {
		families: ['IPv4'],
		types: ['wlan0'],
		fontSize: 20
	},
},