-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme settings tabs are really slow to load #1174
Comments
Hello, I will try to output tabs contents in
|
Thank you @moldcraft, that'd be perfect ! |
removed the "focus tab" functionality, it's not working with this feature
Done (on a separated branch) But there is a problem: Some tabs are "hidden" not rendered, so a lot of inputs are not present in html, and on form submit their values are not sent in POST. I will try to listen form submit -> prevent it -> render and init all options -> trigger submit from code. That will "block" the page (because, again, all options will be loaded at the same time) then the form will be submitted |
sorry I cant have this, I have predefined styles sent to a file and this will not send the rest of the tabs but only the visible one and the ones user has clicked on |
Please download the latest dev version |
cant to this man , I made bunch of layout and menu visual generator options that depend on options being there , none of them work now, you cant go change this after one year of development. I made options types depending on admin and now many of them dont work right |
So I should do an on/off parameter for this feature (enabled by default) ? |
Hi, I'll give it a try now. I think the best way would be to have an option in framework-customizations/theme/config.php Like : $cfg['settings_form_side_tabs'] = true; |
my template generator options is not connected to save but it collects the admin options
so if they are not rendered they cant be collected , I would love to see speed improvement also but I dont think that this is the right solution. yes do on/off ( default off) but this leaves many of us that made custom options types depending on admin without an adequate speed solution. |
where all that can be done with 3 divs and much smaller css class names. But we have a maze of unnecessary html. These are main speed killers. |
here , I trimmed down all unnecessary fw-clear ( clear via css after or give those an actual css layout ) 4 per option
desc and help dont need inner
look at this that cuts 30+KB from 470KB page on 192 options and I did not even touch the tabs and JS and here is where the mess is my admin page actually loads in 1.08sec ( used to be 3sec before this #958 ) but the JS ( show options page + initialize ) slows it down another 0.7sec now I stayed away from all speed killers or I made my own option types to increase the speed, like slider , spinner , typography , the default ones are still killing it especially the slider |
Sorry, I designed the html structure bad at beginning. I can do a html refactor and update all js/css selectors, if users will report/complain that their options or theme scripts used selectors dependent on |
I dont want to break anyone's html or option that is dependent , but main hooks I used are not inner or the clears so that is why I tested the"fat trim" there. Trimming the html , setting class names to normal size instead of this http://prntscr.com/9m4w0w and the most important one is letting HTML load without JS dependency since there is no need for it on input, text area , checkbox , radios and all normal form options types is where we should start. Only options that need initialize are the options that their render depend on JS like slider, switch , multi-picker or typography. think of this , from my 192 options I count 128 text inputs http://prntscr.com/9m4xpe , which means there is no need to do js initialize 128 times on admin page. But by default we run initialize on any option type. So yes I am for refactor but a smart and precise one , not just a new html tree but a carefully picked scan that we know it wont affect anyone. P.S. Thank you for taking every consideration. It means that we deal with someone who cares. |
@2Fwebd Please let us know if it fixes the slow page load problem |
Hi there, I just tried, it loads pretty fast on my side and the saving is working well. I'll release it to my customer and get back if that doesn't fix it but I think that'll :) Cheers, |
sorry for bringing this back up , can we have a callback after the tabs are loaded so that I can do this
and this one is for theme settings only right |
Basically I need to trigger the tabs init no matter if theme settings or popup, so shold I use this instead ?
|
Unyson/framework/static/js/backend-options.js Lines 66 to 86 in 61725ae
Yes, |
@moldcraft , and one more sorry , is there way to add a hook that will not continue to trigger the init if they are already initiated. Add a class to form maybe |
Sure, nothing is initialized twice, options and containers always add an "initialized" class. Unyson/framework/static/js/backend-options.js Line 136 in 61725ae
|
Also to check if lazy tab was initialized or not, check if it has |
@moldcraft what I mean is this , when you click on a button I need all tabs to be initiated before render
now that is triggering every time and I see a lag , like it is initiating tabs every time I click on the button |
Maybe because the css selector is slow (it's not by id or by class, it needs to check every element atts)
Please add here |
OK , this works and it eliminates additional lags, only first one lags a bit ,
testing your suggestion |
returns 4 , but without my check it returns it on every click , that is why I meant to add something to form or to tabs itself for check if they are already initiated |
@moldcraft you made a button that triggers this
? |
ok , must be my template render since it is reloading options just like reset theme options does , so tabs are not initiated on reload. This is why a form container class hook works , I am reloading what is inside of the form. |
either way , is MUCHHHH faster with lazy_tabs , thnx for the improvement . |
@moldcraft , exactly like I said , http://prntscr.com/afxrmc that is after template reload ( the button click ) so re-initiation is a must on next click. No problem , it works either way. |
Hi there,
We have some customers complaining about the slowness of the Theme Settings pages.
As we have a lot of options and there is some PHP conditions for some of them and though a lot of JS loaded for the options. It's true that it can take a while as all is loaded in one piece.
Is there any way to deactivate that and have a different page for each tab ? So we don't load all the options but one tab at the time.
Regards,
2F
Tabs lazy load
Don not render/init all tabs on page load. Render only visible tabs, then init tab on open.
on/off parameter for this feature in
Render all tabs within some DOM elements from javascript:
The text was updated successfully, but these errors were encountered: