X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fjquery%2Fjquery.crmIconPicker.js;h=2cc4bd536cbd597dc504c9b5f5dbbc44a03fde7b;hb=ffc370ffa721fecfaee7cd615119412f5bbf6e67;hp=5dea481a856b629f7e5f26be682cd590fd0c1ece;hpb=c7b6016eb318e6feb668af52cca2e582a8ed571c;p=civicrm-core.git diff --git a/js/jquery/jquery.crmIconPicker.js b/js/jquery/jquery.crmIconPicker.js index 5dea481a85..2cc4bd536c 100644 --- a/js/jquery/jquery.crmIconPicker.js +++ b/js/jquery/jquery.crmIconPicker.js @@ -71,7 +71,7 @@ $.each(icons, function(i, icon) { if (!term.length || icon.replace(/-/g, '').indexOf(term) > -1) { var item = $('').button({ - icons: {primary: icon} + icons: {primary: icon + ' ' + $style.val()} }); $place.append(item); } @@ -81,20 +81,34 @@ function displayDialog() { dialog.append('' + - '' + + '
' + + '' + + '' + + '' + + '
' + '
' ); + var $styleSelect = $('.icon-ctrls select', dialog); + CRM.utils.setOptions($styleSelect, options, ts('Normal')); + $styleSelect.val($style.val()); + $styleSelect.change(function() { + $style.val($styleSelect.val()); + displayIcons(); + }); + $('.icon-ctrls button', dialog).click(pickIcon); displayIcons(); dialog.unblock(); } function pickIcon(e) { var newIcon = $(this).attr('title'), - style = $style.val(); + style = newIcon ? $style.val() : ''; $input.val(newIcon + (style ? ' ' + style : '')).change(); dialog.dialog('close'); e.preventDefault(); @@ -103,7 +117,7 @@ dialog = $('
').dialog({ title: $input.attr('title'), width: '80%', - height: 400, + height: '90%', modal: true }).block() .on('click', 'a', pickIcon)