Skip to content

Commit

Permalink
Merge pull request #8766 from piwik/widget_maximise_footer_bug
Browse files Browse the repository at this point in the history
Fixes #734, fix broken footer toggling when widgets are/were maximized by forcing footer to be expanded when widgets are maximized.
  • Loading branch information
diosmosis committed Sep 17, 2015
2 parents cb813d7 + 2e9d1d8 commit e742c85
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
4 changes: 0 additions & 4 deletions plugins/Annotations/stylesheets/annotations.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
margin-bottom: -5px;
}

.ui-dialog .evolution-annotations > span {
top: 25px;
}

body > .widget .evolution-annotations > span {
top: -25px;
}
Expand Down
15 changes: 8 additions & 7 deletions plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,9 +781,6 @@ $.extend(DataTable.prototype, UIControl.prototype, {
;

var annotationsCss = {left: 6}; // padding-left of .jqplot-graph element (in _dataTableViz_jqplotGraph.tpl)
if (self.isWithinDialog(domElem)) {
annotationsCss['top'] = -datatableFeatures.height() - annotationAxisHeight + noteSize / 2;
}

// set position of evolution annotation icons
annotations.css(annotationsCss);
Expand Down Expand Up @@ -1422,19 +1419,23 @@ $.extend(DataTable.prototype, UIControl.prototype, {
},

handleExpandFooter: function (domElem) {
if (this.isWithinDialog(domElem)) {
return;
}

var footerIcons = $('.dataTableFooterIcons', domElem);

if (!footerIcons.length) {
return;
}

if (this.isWithinDialog(domElem)) {
$('.dataTableFeatures', domElem).addClass('expanded');
}

var self = this;
function toggleFooter(event)
{
if (self.isWithinDialog(domElem)) {
return;
}

var icons = $('.dataTableFooterIcons', domElem);
$('.dataTableFeatures', domElem).toggleClass('expanded');

Expand Down
6 changes: 6 additions & 0 deletions plugins/Dashboard/javascripts/dashboardWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@

var width = Math.floor($('body').width() * 0.7);

var isFooterExpanded = $('.dataTableFeatures', this.element).hasClass('expanded');

var self = this;
this.element.dialog({
title: '',
Expand All @@ -305,6 +307,9 @@
autoOpen: true,
close: function (event, ui) {
self.isMaximised = false;
if (!isFooterExpanded) {
$('.dataTableFeatures', self.element).removeClass('expanded');
}
$('body').off('.dashboardWidget');
$(this).dialog("destroy");
$('#' + self.uniqueId + '-placeholder').replaceWith(this);
Expand All @@ -315,6 +320,7 @@
}
});
this.element.find('div.piwik-graph').trigger('resizeGraph');
$('.dataTableFeatures', this.element).addClass('expanded');

var currentWidget = this.element;
$('body').on('click.dashboardWidget', function (ev) {
Expand Down

0 comments on commit e742c85

Please sign in to comment.