diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-10-07 07:32:32 +0400 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2014-10-07 07:32:32 +0400 |
commit | 928bc57057a3cf8cf087590dea9c76374062d0ac (patch) | |
tree | 9bc9979c3e8c7d35380cd2b0984717671f87b81a /plugins | |
parent | 9df4f668e23b962e3632a383facfa5b44bd74a1e (diff) |
Fixes the UI tests (admin_privacy_settings)
There was a notification that wasn't hidden on page load (as it should have been). This is because the JS code that hides it is in jQuery, and is run on the page load. But the message to hide is inside an Angular directive which is being "rendered" on page load.
So I suspect that when jQuery tries to hide the span, it doesn't exist in the DOM as the Angular directive hasn't generated it yet. Later, when we click on the checkbox, jQuery can find the span and hide it correctly.
This fix is not really pretty but messing with AngularJS from jQuery is not really simple :/
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/PrivacyManager/javascripts/privacySettings.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/PrivacyManager/javascripts/privacySettings.js b/plugins/PrivacyManager/javascripts/privacySettings.js index 4f0260e7d6..f40985b984 100644 --- a/plugins/PrivacyManager/javascripts/privacySettings.js +++ b/plugins/PrivacyManager/javascripts/privacySettings.js @@ -93,7 +93,10 @@ $(document).ready(function () { toggleBlock("deleteLogSettings", $("input[name=deleteEnable]:checked").val()); toggleBlock("anonymizeIPenabled", $("input[name=anonymizeIPEnable]:checked").val()); toggleBlock("deleteReportsSettings", $("input[name=deleteReportsEnable]:checked").val()); - toggleBlock("deleteOldReportsMoreInfo", $("input[name=deleteReportsEnable]:checked").val()); + // This one is in an AngularJS directive, so is generated later + setTimeout(function () { + toggleBlock("deleteOldReportsMoreInfo", $("input[name=deleteReportsEnable]:checked").val()); + }, 500); toggleOtherDeleteSections(); }); |