Commit feaf21fc authored by Ad Schellevis's avatar Ad Schellevis

(ui) hook_stacked_form_tables, don't dig to deep

parent 0b31dc52
...@@ -70,6 +70,8 @@ function hook_stacked_form_tables(match) ...@@ -70,6 +70,8 @@ function hook_stacked_form_tables(match)
row_number = 0; row_number = 0;
// traverse all <tr> tags // traverse all <tr> tags
root_node.find('tr').each(function(){ root_node.find('tr').each(function(){
// only evaluate children under this table or in <thead|tbody|..> element
if (root_node.is($(this).parent()) || root_node.is($(this).parent().parent())) {
var children = $(this).children(); var children = $(this).children();
// copy zebra color on striped table // copy zebra color on striped table
if (root_node.hasClass('table-striped')) { if (root_node.hasClass('table-striped')) {
...@@ -96,6 +98,7 @@ function hook_stacked_form_tables(match) ...@@ -96,6 +98,7 @@ function hook_stacked_form_tables(match)
children.first().addClass('hidden-xs'); children.first().addClass('hidden-xs');
} }
row_number++; row_number++;
}
}); });
// hook in re-apply zebra when table-striped was selected.. (on window resize and initial load) // hook in re-apply zebra when table-striped was selected.. (on window resize and initial load)
if (root_node.data('stripe-color') != undefined) { if (root_node.data('stripe-color') != undefined) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment