[Rt-commit] rt branch, 4.4/search-builder-chosen-add-columns, created. rt-4.2.11-211-gc6cf594

? sunnavy sunnavy at bestpractical.com
Tue Sep 29 12:07:07 EDT 2015


The branch, 4.4/search-builder-chosen-add-columns has been created
        at  c6cf594ccf47e834c143ec3714e836c759bf06ed (commit)

- Log -----------------------------------------------------------------
commit bb79f77fc302d36477398eda578ad4b5a88bdf4a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 29 23:23:21 2015 +0800

    the cf chosen's width is 20em, which is not good as a general width

diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index df52ea6..5eed83d 100644
--- a/share/html/Elements/EditCustomFieldSelect
+++ b/share/html/Elements/EditCustomFieldSelect
@@ -90,7 +90,7 @@
       </select>
 % }
 <select
-  name="<%$name%>" id="<%$name%>" class="CF-<%$CustomField->id%>-Edit<% $use_chosen ? ' chosen' : '' %>"
+  name="<%$name%>" id="<%$name%>" class="CF-Edit CF-<%$CustomField->id%>-Edit<% $use_chosen ? ' chosen' : '' %>"
 % if ($CustomField->BasedOnObj->id) {
   data-cascade-based-on-name="<% $BasedOnName || $NamePrefix . $CustomField->BasedOnObj->id . '-Value' |n %>"
 % }
diff --git a/share/static/js/util.js b/share/static/js/util.js
index f441ef2..77da0e2 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -503,7 +503,7 @@ jQuery(function() {
         });
     });
     ReplaceAllTextareas();
-    jQuery('select.chosen').chosen({ width: '20em', placeholder_text_multiple: ' ', no_results_text: ' ', search_contains: true });
+    jQuery('select.chosen.CF-Edit').chosen({ width: '20em', placeholder_text_multiple: ' ', no_results_text: ' ', search_contains: true });
     AddAttachmentWarning();
     jQuery('a.delete-attach').click( function() {
         var parent = jQuery(this).closest('div');

commit c6cf594ccf47e834c143ec3714e836c759bf06ed
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Sep 29 23:40:01 2015 +0800

    use chosen for "Add Columns" select box
    
    If "AddCol" is clicked, we should not keep the values since those values will
    be already added

diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
index fffec5c..bc930d7 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -54,9 +54,14 @@
 <th><&|/l&>Show Columns</&>:</th>
 </tr>
 
+<script type="text/javascript">
+jQuery( function() {
+    jQuery('select[name=SelectDisplayColumns].chosen').chosen({ width: '12em', placeholder_text_multiple: ' ', no_results_text: ' ', search_contains: true });
+});
+</script>
 <tr>
 
-<td valign="top"><select size="6" name="SelectDisplayColumns" multiple="multiple">
+<td valign="top"><select name="SelectDisplayColumns" multiple="multiple" class="chosen">
 % my %seen;
 % foreach my $field ( grep !$seen{lc $_}++, @$AvailableColumns) {
 <option value="<% $field %>" <% $selected{$field} ? 'selected="selected"' : '' |n%>>\
@@ -124,7 +129,7 @@
 </table>
 
 <%init>
-my $selected = $ARGS{SelectDisplayColumns};
+my $selected = $ARGS{AddCol} ? [] : $ARGS{SelectDisplayColumns};
 $selected = [ $selected ] unless ref $selected;
 my %selected;
 $selected{$_}++ for grep {defined} @{ $selected };

-----------------------------------------------------------------------


More information about the rt-commit mailing list