From dc651394b117b4d5a2aa439bd6b4ee4a4a45592c Mon Sep 17 00:00:00 2001 From: Stefan Matheis Date: Sat, 16 Nov 2013 18:54:15 +0000 Subject: [PATCH] SOLR-4612: Admin UI - Analysis Screen contains empty table-columns git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1542547 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ solr/webapp/web/js/scripts/analysis.js | 32 ++++++++------------------ 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 97eea1c638c..a1a18abf7bf 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -99,6 +99,8 @@ Bug Fixes * SOLR-5445: Proxied responses should propagate all headers rather than the first one for each key. (Patrick Hunt, Mark Miller) +* SOLR-4612: Admin UI - Analysis Screen contains empty table-columns (steffkes) + Other Changes --------------------- diff --git a/solr/webapp/web/js/scripts/analysis.js b/solr/webapp/web/js/scripts/analysis.js index 8aee1299be6..2fc6e9a5fa1 100644 --- a/solr/webapp/web/js/scripts/analysis.js +++ b/solr/webapp/web/js/scripts/analysis.js @@ -355,32 +355,18 @@ sammy.get if( 0 !== type_length ) { var global_elements_count = 0; - for( var i = 0; i < analysis_data[type].length; i += 2 ) + if( 'string' === typeof analysis_data[type][1] ) { - if( 'string' === typeof analysis_data[type][i+1] ) - { - analysis_data[type][i+1] = [{ 'text': analysis_data[type][i+1] }] - } - - var tmp = {}; - var cols = analysis_data[type][i+1].filter - ( - function( obj ) - { - var obj_position = obj.position || 0; - if( !tmp[obj_position] ) - { - tmp[obj_position] = true; - return true; - } - - return false; - } - ); - - global_elements_count = Math.max( global_elements_count, cols.length ); + analysis_data[type][1] = [{ 'text': analysis_data[type][1] }] } + var c = analysis_data[type][1].length; + for( var i = 0; i < c; i++ ) + { + global_elements_count = Math.max( analysis_data[type][1][i].position || 0, global_elements_count ); + } + + var content = '
' + "\n"; content += '' + "\n";