Every time an item is added to the list - 387 times for me - we shuffle elements around and add at least one new one. This causes browsers to trigger style recalculation (to figure out which styles apply to elements with such and such classes) and content reflows (how the text and elements are wrapped to fit available width). We can avoid this by simply detaching the parent element from the DOM tree and attaching it back once we're done - this make it only trigger one recalculation and one reflow. In my profiling on Opera on a Thinkpad T60 (with lazy-loading disabled), these two steps took respectively around 600ms and 400ms. Now they're down to around 50ms each.
jQuery Universal Language Selector
Universal Language Selector
This is a Wikimedia Foundation Internationalization team project.
Quick start
git clone https://github.com/wikimedia/jquery.uls.git
Documentation
For documentation and examples please visit the wiki
How to build and test jQuery ULS
First, get a copy of the git repo by running:
git clone git://github.com/wikimedia/jquery.uls.git
Make sure you have grunt installed by testing:
grunt -version
If not, run:
npm install
To run tests locally, run grunt test. This will run the tests in PhantomJS.
You can also run the tests in a browser by navigating to the test/ directory, but first run grunt to install the submodules.
Coding style
Please follow jQuery coding guidelines
Versioning
For transparency and insight into the release cycle, and to upgrading easier, we use the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch
For more information on SemVer, please visit http://semver.org/.

