Skip to content

Commit

Permalink
refs #4987 show footer icon drawer if not in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed May 1, 2014
1 parent bf1a786 commit 6cd5d7c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 42 deletions.
12 changes: 2 additions & 10 deletions plugins/Annotations/javascripts/annotations.js
Expand Up @@ -519,11 +519,7 @@

loadingAnnotationManager = true;

var isDashboard = !!$('#dashboardWidgetsArea').length;

if (isDashboard) {
$('.loadingPiwikBelow', domElem).insertAfter($('.evolution-annotations', domElem));
}
$('.loadingPiwikBelow', domElem).insertAfter($('.evolution-annotations', domElem));

var loading = $('.loadingPiwikBelow', domElem).css({display: 'block'});

Expand All @@ -545,11 +541,7 @@
loading.css('visibility', 'hidden');

// add & show annotation manager
if (isDashboard) {
manager.insertAfter($('.evolution-annotations', domElem));
} else {
$('.dataTableFeatures', domElem).append(manager);
}
manager.insertAfter($('.evolution-annotations', domElem));

manager.slideDown('slow', function () {
loading.hide().css('visibility', 'visible');
Expand Down
2 changes: 1 addition & 1 deletion plugins/Annotations/stylesheets/annotations.less
Expand Up @@ -12,7 +12,7 @@
top:10px;
}

#dashboard, .ui-dialog {
#content, .ui-dialog {
.evolution-annotations {
margin-top: -5px;
margin-bottom: -5px;
Expand Down
10 changes: 3 additions & 7 deletions plugins/CoreHome/javascripts/dataTable.js
Expand Up @@ -706,7 +706,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
;

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

Expand All @@ -716,11 +716,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
piwik.annotations.placeEvolutionIcons(annotations, domElem);

// add new section under axis
if (self.isDashboard() || self.isWithinDialog(domElem)) {
annotations.insertAfter($('.datatableRelatedReports', domElem));
} else {
datatableFeatures.append(annotations);
}
annotations.insertAfter($('.datatableRelatedReports', domElem));

// reposition annotation icons every time the graph is resized
$('.piwik-graph', domElem).on('resizeGraph', function () {
Expand Down Expand Up @@ -1276,7 +1272,7 @@ $.extend(DataTable.prototype, UIControl.prototype, {
},

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

Expand Down
2 changes: 1 addition & 1 deletion plugins/CoreHome/stylesheets/dataTable/_dataTable.less
Expand Up @@ -285,7 +285,7 @@ table.dataTable img {
padding-bottom: 4px;
}

#dashboard {
#content {

.dataTableFeatures {
&.expanded {
Expand Down
2 changes: 1 addition & 1 deletion plugins/Morpheus/stylesheets/theme.less
Expand Up @@ -489,7 +489,7 @@ table.dataTable .dataTableRowActions {
border-top: 1px solid @silver-80;
}

#dashboard .dataTableFooterIcons {
#content .dataTableFooterIcons {
padding: 6px 8px 0px;
}

Expand Down
Expand Up @@ -15,7 +15,7 @@ angular.module('piwikApp').directive('piwikZenModeSwitcher', function($rootEleme
function showZenModeIsActivatedNotification() {
var UI = require('piwik/UI');
var notification = new UI.Notification();
var message = '<ul><li>To search for menu items, reports or websites use the search box on the top right or press alt+s.</li><li>To show the footer icons in the tables press alt+f.</li><li>To leave the ZenMode press the arrow on the top right or press alt+z</li></ul>';
var message = '<ul><li>To search for menu items, reports or websites use the search box on the top right or press alt+s.</li><li>To leave the ZenMode press the arrow on the top right or press alt+z</li></ul>';
notification.show(message, {
title: 'ZenMode activated',
context: 'info',
Expand Down
25 changes: 17 additions & 8 deletions plugins/ZenMode/angularjs/zen-mode/zen-mode.less
Expand Up @@ -146,8 +146,23 @@
border-top: 0px;
}

#content:not(#dashboardWidgetsArea) .dataTableFooterIcons {
display: none;
#content .foldDataTableFooterDrawer,
#content .dataTableFeatures .expandDataTableFooterDrawer {
opacity: 0;
-webkit-transition: all 300ms ease;
-moz-transition: all 300ms ease;
-ms-transition: all 300ms ease;
-o-transition: all 300ms ease;
transition: all 300ms ease;
}

#content > div:not(#dashboard) .dataTableFeatures .expandDataTableFooterDrawer {
margin-bottom: -20px;
}

#content .dataTableFeatures:hover .foldDataTableFooterDrawer,
#content .dataTableFeatures:hover .expandDataTableFooterDrawer {
opacity: 1 !important;
}

#content h2:nth-of-type(n+2) {
Expand Down Expand Up @@ -179,10 +194,4 @@
margin-left: 13px;
}

table.dataTable tr:hover td.labeleven,
table.dataTable tr:hover td.columneven,
table.dataTable tr:hover td.labelodd,
table.dataTable tr:hover td.columnodd {
background-color: @silver-95 !important;
}
}
13 changes: 0 additions & 13 deletions plugins/ZenMode/javascripts/zen-mode.js
Expand Up @@ -60,14 +60,6 @@ $(document).ready(function () {
updateZenMode();
}

Mousetrap.bind('alt+f', function() {
if (isDashboardWidgetsArea()) {
return;
}

$('.dataTableFooterIcons').toggle();
});

Mousetrap.bind('alt+z', function() {
toggleZenMode();
});
Expand All @@ -83,11 +75,6 @@ $(document).ready(function () {
});
}

function isDashboardWidgetsArea()
{
return !!$('#dashboardWidgetsArea').length;
}

function isDashboard()
{
return !!$('.Menu--dashboard').length;
Expand Down

0 comments on commit 6cd5d7c

Please sign in to comment.