diff --git a/admin/thirdparty/chosen/chosen/chosen.jquery.js b/admin/thirdparty/chosen/chosen/chosen.jquery.js index 491e79140..bb3c1ee4e 100644 --- a/admin/thirdparty/chosen/chosen/chosen.jquery.js +++ b/admin/thirdparty/chosen/chosen/chosen.jquery.js @@ -1,12 +1,6 @@ -// Chosen, a Select Box Enhancer for jQuery and Protoype -// by Patrick Filler for Harvest, http://getharvest.com -// -// Version 0.9.7 -// Full source at https://github.com/harvesthq/chosen -// Copyright (c) 2011 Harvest http://getharvest.com +//based on version 0.9.7 and applied a very simple patch that fix percentaage width support on select tag +//the patch has been documented https://github.com/harvesthq/chosen/issues/300. -// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md -// This file is generated by `cake build`, do not edit it by hand. (function() { var SelectParser; @@ -302,8 +296,10 @@ Copyright (c) 2011 by Harvest container_div = $("
", { id: this.container_id, "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''), - style: 'width: ' + this.f_width + 'px;' + //patch applied: https://github.com/harvesthq/chosen/issues/300 + style: 'width: ' + (this.options.width || this.f_width + 'px;') }); + if (this.is_multiple) { container_div.html('
'); } else { @@ -314,10 +310,13 @@ Copyright (c) 2011 by Harvest this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single")); this.dropdown = this.container.find('div.chzn-drop').first(); dd_top = this.container.height(); - dd_width = this.f_width - get_side_border_padding(this.dropdown); + //patch applied: https://github.com/harvesthq/chosen/issues/300 + dd_width = this.container.width() - get_side_border_padding(this.dropdown); this.dropdown.css({ "width": dd_width + "px", - "top": dd_top + "px" + "top": dd_top + "px", + //patch applied: https://github.com/harvesthq/chosen/issues/300 + "width": dd_width }); this.search_field = this.container.find('input').first(); this.search_results = this.container.find('ul.chzn-results').first(); @@ -558,6 +557,8 @@ Copyright (c) 2011 by Harvest "left": 0 }); this.results_showing = true; + //patch applied: https://github.com/harvesthq/chosen/issues/300 + this.search_field.css('width', (dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field)) + 'px'); this.search_field.focus(); this.search_field.val(this.search_field.val()); return this.winnow_results();