The 'Thanks' pop-over when clicking the thumbs up for the first time appears, but it is still appearing the second time the thumbs up is clicked even after setting its trigger to 'none'
Steps to reproduce:
- Click any thumbs up, 'Thanks' pop-over will appear
- Click anywhere outside such as white area to dismiss the 'Thanks' pop-over
- Click again that thumbs up and the 'Thanks' pop-over is still appearing
In the code, I set my own custom directive to conditionally set the popover-trigger such that when thumbs up is clicked once, it will set the popover-trigger to 'none': Inspected in Element tab that popover-trigger is really set to none.
Code in html:
<span ng-click="sendFeedback(false, result.id)"
uib-popover="Thanks"
popover-trigger="'outsideClick'"
...
my-directive
shown="this.shown[result.id]">
</span>
Code in controller:
feedbackApp.directive('myDirective', function () {
return {
restrict: 'A',
scope: {
shown: '=',
},
link: function(scope, element, attrs) {
scope.$watch('shown', function(shown) {
if (shown)
attrs.$set('popover-trigger', "none");
}
});
}
};
});
Bottom line is if the user intends to undo the thumbs up, the 'Thanks' pop-over should not appear
Here is my full code in public repo
