diff options
Diffstat (limited to 'plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js')
-rw-r--r-- | plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js b/plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js index bbe3c02eb0..cbbccde247 100644 --- a/plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js +++ b/plugins/CorePluginsAdmin/angularjs/plugin-settings/plugin-settings.controller.js @@ -29,7 +29,7 @@ self.isLoading = false; }); - this.save = function () { + this.save = function (settings) { var apiMethod = 'CorePluginsAdmin.setUserSettings'; if ($scope.mode === 'admin') { apiMethod = 'CorePluginsAdmin.setSystemSettings'; @@ -38,22 +38,20 @@ this.isLoading = true; var values = {}; - angular.forEach(this.settingsPerPlugin, function (settings) { - if (!values[settings.pluginName]) { - values[settings.pluginName] = []; - } + if (!values[settings.pluginName]) { + values[settings.pluginName] = []; + } - angular.forEach(settings.settings, function (setting) { - var value = setting.value; - if (value === false) { - value = '0'; - } else if (value === true) { - value = '1'; - } - values[settings.pluginName].push({ - name: setting.name, - value: value - }); + angular.forEach(settings.settings, function (setting) { + var value = setting.value; + if (value === false) { + value = '0'; + } else if (value === true) { + value = '1'; + } + values[settings.pluginName].push({ + name: setting.name, + value: value }); }); @@ -62,7 +60,10 @@ var UI = require('piwik/UI'); var notification = new UI.Notification(); - notification.show(_pk_translate('CoreAdminHome_PluginSettingsSaveSuccess'), {context: 'success'}); + notification.show(_pk_translate('CoreAdminHome_PluginSettingsSaveSuccess'), { + id: 'generalSettings', context: 'success' + }); + notification.scrollToNotification(); }, function () { self.isLoading = false; |