summaryrefslogtreecommitdiffstats
path: root/inventory/static/chosen/chosen.jquery_ready.js
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2015-03-25 21:16:11 +0100
committerSebastian Reichel <sre@ring0.de>2015-03-25 21:16:11 +0100
commit298cd0965391867a8bc62981136eb5fc496d98e0 (patch)
treeec4aabc50d9e73ae5090632d90c828df42ce36ec /inventory/static/chosen/chosen.jquery_ready.js
parent436593504095bea694696da7c5837d2712036b1a (diff)
downloadktt-inventory-system-298cd0965391867a8bc62981136eb5fc496d98e0.tar.bz2
move static files to project
Diffstat (limited to 'inventory/static/chosen/chosen.jquery_ready.js')
-rw-r--r--inventory/static/chosen/chosen.jquery_ready.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/inventory/static/chosen/chosen.jquery_ready.js b/inventory/static/chosen/chosen.jquery_ready.js
new file mode 100644
index 0000000..65308b8
--- /dev/null
+++ b/inventory/static/chosen/chosen.jquery_ready.js
@@ -0,0 +1,24 @@
+(function ($) {
+ $(function () {
+ $(".chzn-select").each(function(i, select) {
+ var $select = $(select);
+
+ // Set overflow:visible on parent .form-row for django admin
+ $select.parents('.form-row').css('overflow', 'visible');
+
+ if (typeof grappelli == 'object') {
+ // Set overflow:visible on grappelli fieldset.module .row
+ $select.parents('.row').filter(function(i) {
+ return $(this).parent('fieldset.module').length;
+ }).css('overflow', 'visible');
+ // Set overflow:visible on grappelli tabular module
+ $select.parents('td').filter(function(i) {
+ return $(this).parent('.module.table').length;
+ }).css('overflow', 'visible');
+ }
+
+ // Initialize Chosen
+ $select.chosen();
+ });
+ });
+})((typeof window.django != 'undefined') ? django.jQuery : jQuery); \ No newline at end of file