From a2c28a9493e6220b6278bf57200d9c07e04a8909 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 22 Sep 2014 21:04:03 -0400 Subject: [PATCH] Common.js - minor cleanup --- js/Common.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.25.1