CRM-13863 - Add select2 class to activity links
authorColeman Watts <coleman@civicrm.org>
Tue, 18 Mar 2014 17:39:18 +0000 (13:39 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 18 Mar 2014 17:39:18 +0000 (13:39 -0400)
templates/CRM/Activity/Form/ActivityLinks.tpl

index 6bad5c71b6d0114ba6bcf1e1d0e404361362d470..3f61c25a1c0d4a2fedd4b3a3f91b461552fcb326 100644 (file)
@@ -30,8 +30,8 @@
 {/if}
 
 {if $as_select} {* on 3.2, the activities can be either a drop down select (on the activity tab) or a list (on the action menu) *}
-<select name="other_activity" id="other_activity" class="form-select">
-  <option value="">{ts}- new activity -{/ts}</option>
+<select name="other_activity" class="crm-form-select crm-select2 crm-action-menu">
+  <option value="">{ts}New activity{/ts}</option>
 {foreach from=$activityTypes key=k item=link}
   <option value="{$urls.$k}">{$link}</option>
 {/foreach}
 {literal}
 <script type="text/javascript">
   cj(function($) {
-    $('#other_activity').change(function() {
+    $('[name=other_activity].crm-action-menu').change(function() {
       var
         $el = $(this),
         url = $el.val();
       if (url) {
-        $el.val('');
+        $el.select2('val', '');
         CRM.loadForm(url).on('crmFormSuccess', function() {
           $el.closest('.crm-ajax-container, #crm-main-content-wrapper').crmSnippet().crmSnippet('refresh');
         });