mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Open external links in product description in a new page
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
%filter-selector{ 'selector-set' => "productPropertySelectors", objects: "[product] | propertiesWithValuesOf" }
|
||||
|
||||
.product-description{"ng-if" => "product.description_html"}
|
||||
%p.text-small{"ng-bind-html" => "::product.description_html"}
|
||||
%p.text-small{"ng-bind-html" => "::product.description_html", "data-controller" => "richtext"}
|
||||
|
||||
.columns.small-12.medium-6.large-6.product-img
|
||||
%img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}
|
||||
|
||||
9
app/webpacker/controllers/richtext_controller.js
Normal file
9
app/webpacker/controllers/richtext_controller.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Controller } from "stimulus";
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.element.querySelectorAll("a").forEach(function (link) {
|
||||
link.target = "_blank";
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user