diff options
author | Stefan Giehl <stefan@matomo.org> | 2021-07-09 01:41:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-09 01:41:38 +0300 |
commit | de01ea3ead5003a351ac09bbc2ecf99f8047c012 (patch) | |
tree | 356717b87448e62df87e753b925e89e14508e647 /plugins/CoreHome/angularjs | |
parent | b2169df5db0e7c0a94e079a392d48db9084a5a79 (diff) |
Fix preselection in site selector form fields (#17742)
* Ensure site selector uses preselected site in form fields
* move attr handling so it's executed when the values are actually available
Diffstat (limited to 'plugins/CoreHome/angularjs')
-rw-r--r-- | plugins/CoreHome/angularjs/siteselector/siteselector.directive.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js index ca94f29ee8..945b70c145 100644 --- a/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js +++ b/plugins/CoreHome/angularjs/siteselector/siteselector.directive.js @@ -65,10 +65,6 @@ } return function (scope, element, attrs, ngModel) { - if (attrs.siteid && attrs.sitename) { - scope.selectedSite = {id: attrs.siteid, name: attrs.sitename}; - } - scope.model.onlySitesWithAdminAccess = scope.onlySitesWithAdminAccess; if (ngModel) { @@ -103,6 +99,10 @@ }); $timeout(function () { + if (attrs.siteid && attrs.sitename) { + scope.selectedSite = {id: attrs.siteid, name: piwik.helper.htmlDecode(attrs.sitename)}; + } + initTopControls(); }); }; |