Skip to content

Commit

Permalink
Fixes #5355, add plus/minus icons to left of rows w/ subtables that c…
Browse files Browse the repository at this point in the history
…hange when tables expand/contract. Also add tooltip to rows w/ subtables.
  • Loading branch information
diosmosis committed Sep 9, 2014
1 parent ae31705 commit c2446bb
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1512,6 +1512,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
}

$(this).next().toggle();
$(this).toggleClass('expanded');
self.repositionRowActions($(this));
}
).size();
Expand Down
3 changes: 2 additions & 1 deletion plugins/CoreHome/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"UnFlattenDataTable": "The report is flat %s Make it hierarchical",
"ViewAllPiwikVideoTutorials": "View all Piwik Video Tutorials",
"WebAnalyticsReports": "Web Analytics Reports",
"YouAreUsingTheLatestVersion": "You are using the latest version of Piwik!"
"YouAreUsingTheLatestVersion": "You are using the latest version of Piwik!",
"ClickRowToExpandOrContract": "Click this row to expand or contract the subtable."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

{% if showRow %}
<tr {% if rowHasSubtable %}id="{{ row.getIdSubDataTable() }}"{% endif %}
class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}">
class="{{ row.getMetadata('css_class') }} {% if rowHasSubtable %}subDataTable{% endif %}{% if shouldHighlightRow %} highlight{% endif %}"
title="{{ 'CoreHome_ClickRowToExpandOrContract'|translate }}">
{% for column in properties.columns_to_display %}
<td>
{% include "@CoreHome/_dataTableCell.twig" with properties %}
Expand Down
18 changes: 18 additions & 0 deletions plugins/Morpheus/stylesheets/theme.less
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,24 @@ table.dataTable {
&.dataTableVizVisitorLog {

}

tr.subDataTable > td:first-child:before {
display: inline-block;
float: left;
top: 0;
width: 1.25em;
font-size: .8em;
font-style: italic;
color:#888;
}

tr.subDataTable:not(.expanded) > td:first-child:before {
content: '+';
}

tr.subDataTable.expanded > td:first-child:before {
content: '-';
}
}

table.dataTable tr.subDataTable:hover > td, table.dataTable tr.subDataTable:hover > td .dataTableRowActions {
Expand Down

0 comments on commit c2446bb

Please sign in to comment.