diff options
author | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-17 04:10:27 +0400 |
---|---|---|
committer | Benaka Moorthi <benaka.moorthi@gmail.com> | 2013-09-17 04:10:27 +0400 |
commit | e4ceaf9911e98b64b44a42ad9a1d52a85891dd6f (patch) | |
tree | fd3d34a6aa622faeedd39b02ef573289ed4fd190 /plugins | |
parent | cdb1c043692c92c6e9a5d9a00a231d4515bb7075 (diff) |
Refs #4077, fix series picker popover placement logic & remove subtable handling from Treemap.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreVisualizations/javascripts/seriesPicker.js | 17 | ||||
-rw-r--r-- | plugins/TreemapVisualization/TreemapDataGenerator.php | 18 |
2 files changed, 9 insertions, 26 deletions
diff --git a/plugins/CoreVisualizations/javascripts/seriesPicker.js b/plugins/CoreVisualizations/javascripts/seriesPicker.js index 705d7e556f..2a722cd539 100644 --- a/plugins/CoreVisualizations/javascripts/seriesPicker.js +++ b/plugins/CoreVisualizations/javascripts/seriesPicker.js @@ -321,14 +321,14 @@ * Positions the popover element. */ _positionPopover: function () { - var popover = this._pickerPopover, + var $body = $('body'), + popover = this._pickerPopover, pickerLink = this.domElem, - seriesPicker = pickerLink.parent(), - plotWidth = seriesPicker.width(), - offsetRight = seriesPicker.offset().left + plotWidth + pickerLinkLeft = pickerLink.offset().left, + bodyRight = $body.offset().left + $body.width() ; - $('body').prepend(popover); + $body.prepend(popover); var neededSpace = popover.outerWidth() + 10; @@ -339,10 +339,11 @@ // try to display popover to the right var margin = parseInt(pickerLink.css('margin-left')) - 4; - - if (margin + neededSpace < plotWidth + + var popoverRight = pickerLinkLeft + margin + neededSpace; + if (popoverRight < bodyRight // make sure it's not too far to the left - || offsetRight - margin - neededSpace < 0 + || popoverRight < 0 ) { popover.css('margin-left', (linkOffset.left - 4) + 'px').show(); } else { diff --git a/plugins/TreemapVisualization/TreemapDataGenerator.php b/plugins/TreemapVisualization/TreemapDataGenerator.php index de4db7c4a6..5d97a56c85 100644 --- a/plugins/TreemapVisualization/TreemapDataGenerator.php +++ b/plugins/TreemapVisualization/TreemapDataGenerator.php @@ -171,8 +171,6 @@ class TreemapDataGenerator if ($rowId == DataTable::ID_SUMMARY_ROW) { $childNode['data']['aggregate_offset'] = $offset + $dataTable->getRowsCount() - 1; - } else if ($row->getIdSubDataTable() !== null) { - $this->addSubtableToNode($childNode, $row, $pastRow); } $node['children'][] = $childNode; @@ -223,22 +221,6 @@ class TreemapDataGenerator return $this->makeNode($this->getNodeId($tableId, $rowId), $label, $data); } - private function addSubtableToNode(&$childNode, $subTableRow, $pastRow) - { - $childNode['data']['idSubtable'] = $subTableRow->getIdSubDataTable(); - $childNode['data']['loaded'] = 1; - - $subTable = $subTableRow->getSubtable(); - $subTable->filter('AddSummaryRow', array(4, Piwik_Translate('General_Others'), $columnToSort = $this->metricToGraph)); //TODO: make constants customizable - - $pastSubtable = false; - if ($pastRow) { - $pastSubtable = $pastRow->getSubtable(); - } - - $this->addDataTableToNode($childNode, $subTable, $pastSubtable, $subTableRow->getIdSubDataTable()); - } - private function getNodeId($tableId, $rowId) { if ($rowId == DataTable::ID_SUMMARY_ROW) { |