A micro jQuery plugin, trimming long strings in multiselect elements. The problem it solves is very specific, but I recently had to deal with it and this is a working way to deal with it withought going for a full select / multiselect replacement plugin like Chosen for example.
Although this plugin has very limited use case it is also a learning experience for me. So any help, criticism and feedback in general is most welcome.
Download the production version or the development version.
Check the annotated source here.
bower install jquery-trim-multiselect
<script src="jquery.js"></script>
<script src="dist/jquery-trim-multiselect.min.jz"></script>
<script>
jQuery(function($) {
// Find options longer than the width of the element and shorten them
$('#myMultiSelect').trimMultiselect();
});
</script>
See demo of the basic usage here.
v0.1.1
- Implemented new algorithm which is a lot faster
- Option to install via bower
v0.0.3 & v0.0.4
- Cleaned up the project folder
- Fixed grunt configuration
- And mainly used to test grunt-bump configuration
v0.0.2
- Better project structure
- Grunt automation
- Initial functionality - slowest but most accurate method
- Demo and github page
- Docs generated with docco
v0.0.1
- Initial release
Copyright (c) 2013 Boyan Yordanov Licensed under the MIT license.