Skip to content

Commit

Permalink
Merge branch 'master' of github.com:piwik/piwik
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Mar 5, 2014
2 parents 4bb969c + 28781af commit bb0377a
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 16 deletions.
9 changes: 8 additions & 1 deletion plugins/Actions/javascripts/actionsDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,16 @@
}
}
});

var table = $(domElem);
if (!table.hasClass('dataTable')) {
table = table.closest('.dataTable');
}
if (stripingNeeded) {
self.addOddAndEvenClasses(table);
}

self.$element.trigger('piwik:actionsSubTableToggled');
}

// toggle the +/- image
Expand Down Expand Up @@ -278,6 +280,9 @@
$('.datatableRelatedReports', content).replaceWith(oldReportsElem);

dataTableSel.replaceWith(content);

content.trigger('piwik:dataTableLoaded');

piwikHelper.lazyScrollTo(content[0], 400);

return content;
Expand Down Expand Up @@ -311,6 +316,8 @@
// we execute the bindDataTableEvent function for the new DIV
self.bindEventsAndApplyStyle($('#' + self.workingDivId), response);

self.$element.trigger('piwik:actionsSubDataTableLoaded');

//bind back the click event (disabled to avoid double-click problem)
self.disabledRowDom.click(
function () {
Expand Down
2 changes: 2 additions & 0 deletions plugins/CoreHome/javascripts/dataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ $.extend(DataTable.prototype, UIControl.prototype, {
dataTableSel.replaceWith(content);
}

content.trigger('piwik:dataTableLoaded');

piwikHelper.lazyScrollTo(content[0], 400);

return content;
Expand Down
11 changes: 5 additions & 6 deletions plugins/Dashboard/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,11 @@ public function addMenus()
$login = Piwik::getCurrentUserLogin();

$dashboards = $this->getAllDashboards($login);
if (count($dashboards) > 1) {
$pos = 0;
foreach ($dashboards AS $dashboard) {
MenuMain::getInstance()->add('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos);
$pos++;
}

$pos = 0;
foreach ($dashboards as $dashboard) {
MenuMain::getInstance()->add('Dashboard_Dashboard', $dashboard['name'], array('module' => 'Dashboard', 'action' => 'embeddedIndex', 'idDashboard' => $dashboard['iddashboard']), true, $pos);
$pos++;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/Dashboard/javascripts/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function copyDashboardToUser() {
}
};

$('body')[0].addEventListener('mouseup', this.onBodyMouseUp);
$('body').on('mouseup', this.onBodyMouseUp);

// setup widgetPreview
this.$element.widgetPreview({
Expand Down Expand Up @@ -222,7 +222,7 @@ function copyDashboardToUser() {
_destroy: function () {
UIControl.prototype._destroy.call(this);

$('body')[0].removeEventListener('mouseup', this.onBodyMouseUp);
$('body').off('mouseup', null, this.onBodyMouseUp);
}
});

Expand Down
1 change: 0 additions & 1 deletion plugins/Dashboard/javascripts/dashboardObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@
* @param {string} [action] action to perform (defaults to saveLayout)
*/
function saveLayout(action) {

var columns = [];

var columnNumber = 0;
Expand Down
7 changes: 5 additions & 2 deletions plugins/Dashboard/javascripts/dashboardWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
onRemove: null,
onRefresh: null,
onMaximise: null,
onMinimise: null
onMinimise: null,
autoMaximiseVisualizations: ['tableAllColumns', 'tableGoals']
},

/**
Expand Down Expand Up @@ -144,7 +145,9 @@
* @param {object} parameters
*/
setParameters: function (parameters) {
if (!this.isMaximised && (parameters.viewDataTable == 'tableAllColumns' || parameters.viewDataTable == 'tableGoals')) {
if (!this.isMaximised
&& this.options.autoMaximiseVisualizations.indexOf(parameters.viewDataTable) !== -1
) {
this.maximise();
}
for (var name in parameters) {
Expand Down
6 changes: 3 additions & 3 deletions plugins/SegmentEditor/javascripts/Segmentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ $(document).ready(function() {

var idx = null;
for (idx in self.props.availableSegments) {
if (self.props.availableSegments[idx].definition == params.definition) {
if (self.props.availableSegments[idx].idsegment == params.idSegment) {
break;
}
}
Expand Down Expand Up @@ -1170,7 +1170,7 @@ $(document).ready(function() {
}
};

$('body')[0].addEventListener('mouseup', this.onMouseUp);
$('body').on('mouseup', this.onMouseUp);
};

/**
Expand All @@ -1194,7 +1194,7 @@ $(document).ready(function() {
_destroy: function () {
UIControl.prototype._destroy.call(this);

$('body')[0].removeEventListener('mouseup', this.onMouseUp);
$('body').off('mouseup', null, this.onMouseUp);
}
});

Expand Down
3 changes: 3 additions & 0 deletions plugins/Widgetize/templates/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,7 @@
<div id='iframeDivToExport' style='display:none;'></div>
</div>
</div>

{% include "@Dashboard/_widgetFactoryTemplate.twig" %}

{% endblock %}
2 changes: 1 addition & 1 deletion tests/PHPUnit/Integration/Core/WidgetsListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGet()
'SEO' => 2,
'Example Widgets' => 4,
'DevicesDetection_DevicesDetection' => 7,
'Insights_Category' => 1
'Insights_WidgetCategory' => 2
);

// number of main categories
Expand Down

0 comments on commit bb0377a

Please sign in to comment.