Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes broken footer toggling when widgets are/were maximized #8766

Merged
merged 4 commits into from
Sep 17, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions plugins/Annotations/stylesheets/annotations.less
Original file line number Diff line number Diff line change
@@ -27,10 +27,6 @@
margin-bottom: -5px;
}

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

body > .widget .evolution-annotations > span {
top: -25px;
}
15 changes: 8 additions & 7 deletions plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
@@ -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);
@@ -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');

6 changes: 6 additions & 0 deletions plugins/Dashboard/javascripts/dashboardWidget.js
Original file line number Diff line number Diff line change
@@ -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: '',
@@ -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);
@@ -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) {