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.
72 lines
4.0 KiB
HTML
72 lines
4.0 KiB
HTML
<!--
|
|
<notification id='exampleNotification'>
|
|
<div class="panel panel-warning">
|
|
<div class="panel-heading"><h3 class="panel-title"><span class="fa fa-exclamation-circle"></span><span translate>Notice</span></h3></div>
|
|
<div class="panel-body">
|
|
<p translate>This is an example notification. ID of the notification should be appended to Options.UnackedNotificationIDs of the config.</p>
|
|
</div>
|
|
<div class="panel-footer">
|
|
<button type="button" class="btn btn-sm btn-default pull-right" ng-click="dismissNotification('exampleNotification')">
|
|
<span class="fa fa-check"></span> <span translate>OK</span>
|
|
</button>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
</div>
|
|
</notification>
|
|
-->
|
|
|
|
<notification id="channelNotification">
|
|
<div class="panel panel-success">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="fa fa-flash"></span> <span translate>Automatic upgrades</span></h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<p translate>Automatic upgrade now offers the choice between stable releases and release candidates.</p>
|
|
<p>
|
|
<span translate>Release candidates contain the latest features and fixes. They are similar to the traditional bi-weekly Syncthing releases.</span>
|
|
<span translate>Stable releases are delayed by about two weeks. During this time they go through testing as release candidates.</span>
|
|
<span translate>You can read more about the two release channels at the link below.</span>
|
|
</p>
|
|
<p translate>You can change your choice at any time in the Settings dialog.</p>
|
|
<p><a href="https://docs.syncthing.net/users/releases.html"><span class="fa fa-fw fa-book"></span> <span translate>Learn more</span></a></p>
|
|
</div>
|
|
<div class="panel-footer">
|
|
<button type="button" class="btn btn-sm btn-default pull-right" ng-click="editSettings(); dismissNotification('channelNotification')">
|
|
<span class="fa fa-cog"></span> <span translate>Settings</span>
|
|
</button>
|
|
<button type="button" class="btn btn-sm btn-default" ng-click="dismissNotification('channelNotification')">
|
|
<span class="fa fa-check"></span> <span translate>OK</span>
|
|
</button>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
</div>
|
|
</notification>
|
|
|
|
<notification id="fsWatcherNotification">
|
|
<div class="panel panel-success">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title"><span class="fa fa-flash"></span> <span translate>Watching for Changes</span></h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<p translate>Continuously watching for changes is now available within Syncthing. This will detect changes on disk and issue a scan on only the modified paths. The benefits are that changes are propagated quicker and that less full scans are required.</p>
|
|
<p><a href="https://docs.syncthing.net/users/syncing.html#scanning"><span class="fa fa-fw fa-book"></span> <span translate>Learn more</span></a></p>
|
|
<p>
|
|
<span translate>Do you want to enable watching for changes for all your folders?</span><br/>
|
|
<span translate>Additionally the full rescan interval will be increased (times 60, i.e. new default of 1h). You can also configure it manually for every folder later after choosing No.</span>
|
|
</p>
|
|
<p translate translate-value-syncthing-inotify="syncthing-inotify">Warning: If you are using an external watcher like {%syncthingInotify%}, you should make sure it is deactivated.</p>
|
|
</div>
|
|
<div class="panel-footer clearfix">
|
|
<div class="pull-right">
|
|
<button type="button" class="btn btn-primary btn-sm" ng-click="activateAllFsWatchers(); dismissNotification('fsWatcherNotification')">
|
|
<span class="fa fa-check"></span> <span translate>Yes</span>
|
|
</button>
|
|
<button type="button" class="btn btn-default btn-sm" ng-click="dismissNotification('fsWatcherNotification')">
|
|
<span class="fa fa-times"></span> <span translate>No</span>
|
|
</button>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
</div>
|
|
</div>
|
|
</notification>
|