syncthing/gui/default
Jakob Borg ed4807d9a4
gui: Fix scopes in notification directive (fixes #4941) (#4948)
The directive lives in its own isolated scope (where we put the visible() function). The stuff transcluded into the notification directive lives in the root scope and doesn't have access to the directive scope. Hence we cannot call dismiss() from inside the directive.

Similarly, config does not exist by itself in the directive scope, we need $parent to access the root scope.

Reference: https://docs.angularjs.org/guide/directive#isolating-the-scope-of-a-directive

How this worked before is a mystery. My guess is Angular bug with directive scope that was fixed in 1.3. One possibility is that transclude plus scope: true (which doesn't make sense as that is supposed to be an object) resulted in the root scope being used in the directive itself. This would then "work" as long as there is only one notification, as visible() and dismiss() would then be registered on the root scope, thus accessible from within the notification but also overridden by any notification rendered.
2018-05-13 07:44:19 +02:00
..
assets gui, man: Update docs & translations 2018-05-09 07:45:15 +02:00
syncthing gui: Fix scopes in notification directive (fixes #4941) (#4948) 2018-05-13 07:44:19 +02:00
vendor gui: Update Angular to 1.3.20, enable $applyAsync (fixes #4918) 2018-05-05 11:13:16 +01:00
index.html gui: Localize number formatting (fixes #4896) (#4902) 2018-04-25 10:26:49 +02:00
modal.html all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00