Change button with onclick to link with href
authorFrank Sträter <fstrater@beeldengeluid.nl>
Tue, 24 Sep 2019 12:43:11 +0000 (14:43 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Fri, 18 Oct 2019 08:30:28 +0000 (10:30 +0200)
client/src/app/shared/user-subscription/subscribe-button.component.html
client/src/app/shared/user-subscription/subscribe-button.component.ts

index c4dec239f2eb946ad5db6c57766749fd58f00b32..25f3be2155613bc1a68959e68e554effad71d79e 100644 (file)
@@ -46,7 +46,7 @@
       <div class="dropdown-divider"></div>
 
       <h6 class="dropdown-header" i18n>Using a syndication feed</h6>
-      <button (click)="rssOpen()" class="dropdown-item" i18n>Subscribe via RSS</button>
+      <a [href]="rssUri" target="_blank" class="dropdown-item" i18n>Subscribe via RSS</a>
 
     </div>
   </div>
index 25515f6ea31cd6367673c3720ad739edefb34323..b04e230f0b3173ec25eb101b5347b9d48f180287 100644 (file)
@@ -36,6 +36,14 @@ export class SubscribeButtonComponent implements OnInit {
     return this.videoChannel.url
   }
 
+  get rssUri () {
+    const rssFeed = this.videoService
+                      .getVideoChannelFeedUrls(this.videoChannel.id)
+                      .find(i => i.format === FeedFormat.RSS)
+
+    return rssFeed.url
+  }
+
   ngOnInit () {
     if (this.isUserLoggedIn()) {
       this.userSubscriptionService.doesSubscriptionExist(this.channelHandle)
@@ -100,12 +108,4 @@ export class SubscribeButtonComponent implements OnInit {
   gotoLogin () {
     this.router.navigate([ '/login' ])
   }
-
-  rssOpen () {
-    const rssFeed = this.videoService
-                      .getVideoChannelFeedUrls(this.videoChannel.id)
-                      .find(i => i.format === FeedFormat.RSS)
-
-    window.open(rssFeed.url)
-  }
 }