diff options
author | Stefan Giehl <stefan@piwik.org> | 2017-07-07 13:15:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-07 13:15:39 +0300 |
commit | 08098d90b920073d831dc984de898a6ddb109fe8 (patch) | |
tree | 35a2d143d445c2f5c30fc822bf4b4e9a8cc05c89 /plugins/SegmentEditor | |
parent | 12d985d8ea083bd90b647c2bdb85e1d78f18abb3 (diff) |
prevent angular compiler from screwing up selected values (#11781)
Diffstat (limited to 'plugins/SegmentEditor')
-rw-r--r-- | plugins/SegmentEditor/javascripts/Segmentation.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js index 1ca8bfc014..0153a6b491 100644 --- a/plugins/SegmentEditor/javascripts/Segmentation.js +++ b/plugins/SegmentEditor/javascripts/Segmentation.js @@ -1012,7 +1012,6 @@ Segmentation = (function($) { } // remove any remaining forms - self.form = getFormHtml(); self.target.prepend(self.form); @@ -1028,8 +1027,11 @@ Segmentation = (function($) { placeSegmentationFormControls(); + // needs to be done before jQuery selects are built, as angular compiler screws up the selected values + piwikHelper.compileAngularComponents(self.target); + if(mode == "edit") { - var userSelector = $(self.form).find('.enable_all_users_select > option[value="' + segment.enable_all_users + '"]').prop("selected",true); + $(self.form).find('.enable_all_users_select > option[value="' + segment.enable_all_users + '"]').prop("selected",true); // Replace "Visible to me" by "Visible to $login" when user is super user if(hasSuperUserAccessAndSegmentCreatedByAnotherUser(segment)) { @@ -1056,8 +1058,6 @@ Segmentation = (function($) { $(".segmentListContainer", self.target).hide(); self.target.closest('.segmentEditorPanel').addClass('editing'); - - piwikHelper.compileAngularComponents(self.target); }; var closeForm = function () { |