Index: branches/5.1.x/core/admin_templates/js/catalog.js =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12127) +++ branches/5.1.x/core/admin_templates/js/catalog.js (.../catalog.js) (revision 12657) @@ -24,12 +24,22 @@ this.searchInfo = {}; // information about search (for each tab) } -Catalog.prototype.Init = function () { +Catalog.prototype.Init = function ($auto_hide_tabs) { var $prefix = this.queryTabRegistry('prefix', this.ActivePrefix, 'prefix'); if ($prefix !== this.ActivePrefix && this.TabRegistry.length > 0) { // ActivePrefix not set or has non-existing prefix value this.ActivePrefix = this.TabRegistry[0]['prefix']; } + + if ($auto_hide_tabs === undefined) { + $auto_hide_tabs = true; + } + + if ((this.TabRegistry.length == 1) && $auto_hide_tabs) { + // only one tab -> hide all tab bar + $('div.tab-viewport').parents('table:first').hide(); + } + this.SetAlternativeTabs(); this.AfterInit(); } @@ -368,14 +378,28 @@ } Catalog.prototype.displaySearch = function ($prefix) { - var $search_input = document.getElementById('search_keyword') + var $search_input = $('#search_keyword'); - $search_input.setAttribute('PrefixSpecial', $prefix); + $search_input.attr('PrefixSpecial', $prefix); if (this.searchInfo[$prefix]) { - $search_input.value = this.searchInfo[$prefix].keyword; - $search_input.setAttribute('Grid', this.searchInfo[$prefix].grid); + $search_input + .val(this.searchInfo[$prefix].keyword) + .attr('Grid', this.searchInfo[$prefix].grid); + + if (this.searchInfo[$prefix].keyword) { + // catalog tab found and keyword present + $search_input.addClass('filter-active'); + } + else { + // catalog tab found and keyword missing + $search_input.removeClass('filter-active'); + } } + else { + // catalog tab not found + $search_input.removeClass('filter-active'); + } } Catalog.prototype.setCurrentCategory = function($prefix, $category_id) {