Index: admin_templates/js/catalog.js =================================================================== --- admin_templates/js/catalog.js (revision 13931) +++ admin_templates/js/catalog.js (working copy) @@ -93,29 +93,27 @@ return ; } - var $text = $request.responseText; + var $js_part = ''; + var $html_part = ''; + var $parts = $request.responseText.split($object.Separator); // (0 - JavaScript, 1 - html) OR (0 - html) - $params = $params.split(','); + if ($parts.length == 2) { + $html_part = $parts[1]; + $js_part = $parts[0]; + } + else { + $html_part = $parts[0]; + } - var $js_end = $text.indexOf($object.Separator); - if ($js_end != -1) { - // allow to detect if output is permitted by ajax request parameters - var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n"; + $params = $params.split(','); // 0 - target div + $.globalEval('$request_visible = ' + ($params[0].length ? 'true' : 'false')); - if ($params[0].length) { -// document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length); - $( document.getElementById($params[0]) ).html( $text.substring($js_end + $object.Separator.length) ); - eval($request_visible + $text.substring(0, $js_end)); - } - else { - // eval JS only & set mark that js should not use HTML as usual in grids - eval($request_visible + $text.substring(0, $js_end)); - } + if ($params[0].length) { + $('#' + jq($params[0])).html($html_part); } - else if ($params[0].length) { - document.getElementById($params[0]).innerHTML = $text; - } + $.globalEval($js_part); + // pass catalog object and loaded tab name to event handler $('body').trigger('CatalogTabLoad', [$object, $params[0].replace(/_div$/, '')]); Index: kernel/db/db_tag_processor.php =================================================================== --- kernel/db/db_tag_processor.php (revision 13931) +++ kernel/db/db_tag_processor.php (working copy) @@ -257,37 +257,12 @@ $block_params['filter_field'] = isset($options['filter_field']) ? $options['filter_field'] : $field; $w = $picker_helper->GetWidth($field); - if ($w) $options['width'] = $w; - /*if (isset($options['filter_width'])) { - $block_params['filter_width'] = $options['filter_width']; + if ($w) { + // column picker width overrides width from unit config + $block_params['width'] = $w; } - elseif (isset($options['width'])) { - if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) { - if ($options['width'] < 60) { - $options['width'] = 60; - $block_params['filter_width'] = 20; - } - else { - $block_params['filter_width'] = $options['width'] - 40; - } - } - else { - $block_params['filter_width'] = max($options['width']-10, 20); - } - }*/ - /*if (isset($block_params['filter_width'])) $block_params['filter_width'] .= 'px'; - - if (isset($options['filter_block']) && preg_match('/range/', $options['filter_block'])) { - $block_params['filter_width'] = '20px'; - } - else { - $block_params['filter_width'] = '97%'; -// $block_params['filter_width'] = max($options['width']-10, 20); - }*/ - - $field_options = $object->GetFieldOptions($field); if (array_key_exists('use_phrases', $field_options)) { $block_params['use_phrases'] = $field_options['use_phrases']; @@ -297,6 +272,7 @@ $o.= $this->Application->ParseBlock($block_params, 1); } + return $o; }