eureka2 / G6K

Generator of calculation simulator (calculator)
MIT License
20 stars 19 forks source link

Listboxes #12

Closed richpeck closed 5 years ago

richpeck commented 5 years ago

Hi there,

I have an implementation of G6K running as an iFrame. Whilst the system works perfectly, there is an issue with the listbox component - because it's styled as an "absolute" position, it is not tracked in the DOM.

I have tried hacking the CSS and JS and feel the only way to do this reliably is to get rid of the JS listbox functionality. I want the default select box to appear again - how do you do this?

Many thanks

Rich

eureka2 commented 5 years ago

Hi,

G6K is not designed to work in an iframe because the page expands (fields are added) as the simulation progresses.

Regarding your question, you can comment or delete lines 3286 to 3290 in the g6k.js script:

            $( ".disposition-classic select").each(function(k) {
                if (! this.hasAttribute('data-widget')) {
                    $(this).listbox();
                }
            });

then reminify g6k.js in g6k.min.js

Best regards

richpeck commented 5 years ago

Thanks, yep appreciate the point about the iframe - got it working with this iFrame resizer library. As the listbox was not a DOM element, the resizer couldn't work correctly (as expected).

Your code worked (thank you). Do you have a donate button?

iframe

richpeck commented 5 years ago

I can share the code for the resize if you wanted it for a wiki page or something.

eureka2 commented 5 years ago

hi,

The listbox component is no longer used by default in the master, 3.x and 4.x branches

This component can be used explicitly on certain fields by simulator via the administration module, it is the responsibility of the administrator of the simulator.