Formula/Script behaves differently when in Full Screen View
Hi Ninox Forum Followers,
I have a formula/script as found below that behaves differently when in the full screen view.
The behavior resorts back to displaying the time when the full screen is reduced back to the default form view. The behavior is consistent.
Please look this over to see where I may be able to make changes.
I sent this to support, and they suggested that I put this into the forum.
thanks for looking!!
let css := "
<style>
main {
font-family: 'Noto Sans', sans-serif;
font-size: 1.5em;
}
</style>";
let content := "
<main id='clock'></main>
<script>
function addZero(i) {
if (i < 10) {i = '0' + i}
return i;
}
setInterval(function() {
let now = new Date();
let hours = now.getHours();
let minutes = now.getMinutes();
let seconds = now.getSeconds();
let meridiem = hours >= 12 ? 'PM' : 'AM'; // Determine AM or PM
// Convert hours to 12-hour format
hours = hours % 12 || 12;
let node = document.querySelector('#clock');
node.innerHTML = addZero(hours) + ':' + addZero(minutes) + ':' + addZero(seconds) + ' ' + meridiem;
}, 1000);
</script>
";
html(css + content)
10 replies
-
When in the full screen view the field is blank
-
To be clear, if you go full screen using the brower fullscreen (either button or menu) then it shows.
If you use the openFullscreen() command then it disappears. Put the following code in a button on the Form view you have your clock:
openFullScreen(this)
Sam, were you clear with Ninox about how you got into full screen? This seems like a Ninox bug.
-
I don't know if it is a bug or a design decision, but it doesn't look like you can modify the fullscreen DOM with javascript. Script appears to work though as the attached database demonstrates. Even if you try to manipulate the DOM in fullscreen mode it only affects the non-fullscreen element.
-
I have tried this as well using a toggle to switch between fullScreen or not. The clock disappears when in fullscreen. Pity about that.
Content aside
- Status Answered
- 5 mths agoLast active
- 10Replies
- 95Views
-
5
Following