Hi folks,
In my new custom UI node I would like to be able to hide or show my component dynamically. We had a rather similar discussion some time ago, but then we wanted "always" to hide or show the content.
This is how it works:
- The UI node shows its content, i.e. a DIV element with a video element inside.
- The user clicks a button to hide the video.
- My UI node sends a message to my client-side to hide the content.
- In the client side, I hide the video element by removing it from its parent (i.e. the div element):
// Watch input messages arriving from the Node-RED flow $scope.$watch('msg', function(newVal, oldVal) { ... switch(newVal.payload) { case "show_video": // Add the video element to the DOM tree $scope.divElement.appendChild($scope.videoElement); break; case "hide_video": // Remove the video element from the DOM tree $scope.divElement.removeChild($scope.videoElement); break; } })
As you can see in the screenshot, the video element is hidden but the empty space remains.
When I look in the Chrome inspector, I see indeed (while my div has height 100%) that the md-card element has fixed dimensions in pixels:
Is there any way around this?
[EDIT] or is this against the whole md-card dimension mechanism of the dashboard. Should I instead workaround it by show a dummy image (e.g. like 'press to start playing ...')?
Thanks !!!
Bart