.crm-container.ui-dialog {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}
-
+.crm-container.ui-dialog.ui-draggable:before {
+ display:block;
+ content: " ";
+ width: 16px;
+ height: 16px;
+ background: url("../i/icons/jquery-ui-3E3E3E.png") no-repeat -80px -224px;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+}
.crm-container .ui-dialog-titlebar.ui-widget-header {
background: url("../i/crm-button-bg.gif") repeat-x scroll left center #70716B;
color: #F5F6F1;
return $(this).each(function () {
var
$el = $(this),
- defaults = {allowClear: !$el.hasClass('required')};
+ settings = {allowClear: !$el.hasClass('required')};
// quickform doesn't support optgroups so here's a hack :(
$('option[value^=crm_optgroup]', this).each(function () {
$(this).nextUntil('option[value^=crm_optgroup]').wrapAll('<optgroup label="' + $(this).text() + '" />');
});
// Defaults for single-selects
if ($el.is('select:not([multiple])')) {
- defaults.minimumResultsForSearch = 10;
+ settings.minimumResultsForSearch = 10;
if ($('option:first', this).val() === '') {
- defaults.placeholderOption = 'first';
+ settings.placeholderOption = 'first';
}
}
- $el.select2($.extend(defaults, $el.data('select-params') || {}, options || {}));
+ $.extend(settings, $el.data('select-params') || {}, options || {});
+ if (settings.ajax) {
+ $el.addClass('crm-ajax-select');
+ }
+ $el.select2(settings);
});
};
$el.data('select-params', $.extend({}, $el.data('select-params') || {}, options.select));
$el.data('api-params', $.extend({}, $el.data('api-params') || {}, options.api));
$el.data('create-links', options.create || $el.data('create-links'));
- $el.addClass('crm-ajax-select crm-' + entity + '-ref');
+ $el.addClass('crm-form-entityref crm-' + entity + '-ref');
var settings = {
// Use select2 ajax helper instead of CRM.api because it provides more value
ajax: {
}
$el.parent().find('.ui-dialog-titlebar-close').attr('title', ts('Close'));
// Add resize button
- if ($el.parent().hasClass('crm-container')) {
+ if ($el.parent().hasClass('crm-container') && $el.dialog('option', 'resizable')) {
$el.parent().find('.ui-dialog-titlebar').append($('<button class="crm-dialog-titlebar-resize ui-dialog-titlebar-close" title="'+ts('Resize')+'" style="right:2em;"/>').button({icons: {primary: 'ui-icon-newwin'}, text: false}));
$('.crm-dialog-titlebar-resize', $el.parent()).click(function(e) {
if ($el.data('origSize')) {
message: ts('Are you sure you want to continue?'),
width: 'auto',
modal: true,
+ resizable: false,
dialogClass: 'crm-container crm-confirm',
close: function () {
$(this).dialog('destroy').remove();
.on('click', 'a.crm-image-popup', function(e) {
CRM.confirm({
title: ts('Preview'),
+ resizable: true,
message: '<div class="crm-custom-image-popup"><img src=' + $(this).attr('href') + '></div>',
options: null
});
<script type="text/javascript">
CRM.$(function($) {
var $form = $("#{/literal}{$form.formName}{literal}");
- $('input[name=unclosed_case_id]', $form).select2({
+ $('input[name=unclosed_case_id]', $form).crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
ajax: {
open: function() {
var dialog = this;
$('input[name=select_merge_tag]', dialog)
- .select2({
+ .crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select tag -{/ts}'{literal},
minimumInputLength: 1,
ajax: {
<script type="text/javascript">
CRM.$(function($) {
var $form = $("#{/literal}{$form.formName}{literal}");
- $('input[name=link_to_case_id]', $form).select2({
+ $('input[name=link_to_case_id]', $form).crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
ajax: {
var selectedCaseId = '';
var contactId = '';
CRM.$(function($) {
- $('input[name=unclosed_case_id]', '#fileOnCaseDialog').select2({
+ $('input[name=unclosed_case_id]', '#fileOnCaseDialog').crmSelect2({
placeholder: {/literal}'{ts escape="js"}- select case -{/ts}'{literal},
minimumInputLength: 1,
ajax: {
title: dialogTitle,
modal: true,
width: 600,
- height: 270,
+ height: 'auto',
close: function( event, ui ) {
cj('input[name=unclosed_case_id]', '#fileOnCaseDialog').select2('destroy');
cj(this).hide().dialog("destroy");
},
buttons: {
- "{/literal}{ts escape='js'}Ok{/ts}{literal}": function() {
+ "{/literal}{ts escape='js'}Save{/ts}{literal}": function() {
var subject = cj("#case_activity_subject").val( );
var targetContactId = cj("#target_contact_id").val( );
return false;
}
- cj(this).dialog("destroy");
+ cj(this).dialog("close");
var postUrl = {/literal}"{crmURL p='civicrm/ajax/activity/convert' h=0 }"{literal};
cj.post( postUrl, { activityID: activityID, caseID: selectedCaseId, contactID: contactId, newSubject: subject, targetContactIds: targetContactId, mode: action, key: {/literal}"{crmKey name='civicrm/ajax/activity/convert'}"{literal} },
},
"{/literal}{ts escape='js'}Cancel{/ts}{literal}": function() {
cj(this).dialog("close");
- cj(this).dialog("destroy");
}
}
dialog = CRM.confirm({
title: $(this).attr('title') || $(this).text(),
message: detached[target],
+ resizable: true,
open: miniForms[target].pre
})
.on('dialogclose', function() {
<script type="text/javascript">
CRM.$(function($) {
// FIXME: This could be much simpler as an entityRef field but the priceFieldValue api doesn't currently support the filters we need
- $('#participant_fee_id').select2({
+ $('#participant_fee_id').crmSelect2({
placeholder: {/literal}'{ts escape="js"}- any -{/ts}'{literal},
minimumInputLength: 1,
allowClear: true,
$('input.crm-token-selector', form)
.addClass('crm-action-menu')
.change(insertToken)
- .select2({
+ .crmSelect2({
data: form.data('tokens'),
placeholder: '{/literal}{ts escape='js'}Insert Token{/ts}{literal}'
});