From: Coleman Watts Date: Tue, 23 Sep 2014 01:04:03 +0000 (-0400) Subject: Common.js - minor cleanup X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a2c28a9493e6220b6278bf57200d9c07e04a8909;p=civicrm-core.git Common.js - minor cleanup --- diff --git a/js/Common.js b/js/Common.js index 8dfdaf2d6a..db365f3bb9 100644 --- a/js/Common.js +++ b/js/Common.js @@ -420,11 +420,11 @@ CRM.strings = CRM.strings || {}; $el.crmSelect2($.extend(settings, $el.data('select-params'), selectParams)) .on('select2-selecting.crmEntity', function(e) { if (e.val === "0") { + // Create a new term e.object.label = e.object.term; CRM.api3(entity, 'create', $.extend({name: e.object.term}, $el.data('api-params').params || {})) .done(function(created) { var - multiple = !!$el.data('select-params').multiple, val = $el.select2('val'), data = $el.select2('data'), item = {id: created.id, label: e.object.term}; @@ -632,9 +632,7 @@ CRM.strings = CRM.strings || {}; } advmultiselectResize(); - $(window).resize(function () { - advmultiselectResize(); - }); + $(window).resize(advmultiselectResize); $.fn.crmtooltip = function () { $(document)