bartbutenaers / node-red-contrib-ui-svg

A Node-RED widget node to show interactive SVG (vector graphics) in the dashboard
Apache License 2.0
94 stars 27 forks source link

Expanding the editor #11

Closed bartbutenaers closed 5 years ago

bartbutenaers commented 5 years ago

Currently the editor cannot be expanded.

Steve-Mcl commented 5 years ago

uibuilder v2 has a nice feature.

image The expand button maximises an div "#edit-props" to full screen.

The code looks like this...


            $('#node-function-expand-js').click(function(e) { //the expand button
                e.preventDefault()

                // Are we in fullscreen? Variable is updated when oneditresize calls setACEheight()
                if (uiace.fullscreen === false) {
                    // Select the editor components and make full-screen, triggers oneditresize()
                    var viewer = $('#edit-props')[0]
                    var rFS = viewer.requestFullscreen || viewer.mozRequestFullScreen || viewer.webkitRequestFullscreen || viewer.msRequestFullScreen
                    if (rFS) rFS.call(viewer)

                    // TODO: Add popup if no method is available
                } else {
                    // Already in fullscreen so lets exit, triggers oneditresize()
                    document.exitFullscreen()
                }

            })