diff --git a/plugins/Dashboard/javascripts/dashboardWidget.js b/plugins/Dashboard/javascripts/dashboardWidget.js index 33adbc0a9bc1d01166bdd7ec949d3599ee7f7134..9880f4ed8ec08daffb790e211b04aa3ca97ee4a3 100755 --- a/plugins/Dashboard/javascripts/dashboardWidget.js +++ b/plugins/Dashboard/javascripts/dashboardWidget.js @@ -32,7 +32,8 @@ isHidden: false, onChange: null, widgetParameters: {}, - title: null + title: null, + onRemove: null }, /** @@ -229,8 +230,12 @@ $('.button#close', widgetElement) .on('click.dashboardWidget', function (ev) { piwikHelper.modalConfirm('#confirm', {yes: function () { - self.element.remove(); - self.options.onChange(); + if (self.options.onRemove) { + self.options.onRemove(self.element); + } else { + self.element.remove(); + self.options.onChange(); + } }}); });