Newb Posted October 3, 2014 Share Posted October 3, 2014 (edited) Hi, may be wrong forum but i didn`t find better, we got some problem with admin script. Our store has a lot of features, and changing language in admin product tab became too slow. So we look into JS (admin.js) and found $('.translatable').each(function() { $(this).find('.lang_' + id_language_new) .show() .siblings('div:not(.displayed_flag):not(.clear)').hide(); $('.language_current').attr('src', '../img/l/' + id_language_new + '.jpg'); }); Changeing src for image takes too many time, but the question why show/hide works in current context (for current element in loop), and flag change for every field. So little changes makes it faster: $('.translatable').each(function() { $(this).find('.lang_' + id_language_new) .show() .siblings('div:not(.displayed_flag):not(.clear)').hide(); $(this).find('.language_current').attr('src', '../img/l/' + id_language_new + '.jpg'); }); Edited October 3, 2014 by Newb (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now