Open external links in product description in a new page

This commit is contained in:
binarygit
2023-11-04 17:01:02 +05:45
parent 1107083bc9
commit e78fe663d2
2 changed files with 10 additions and 1 deletions

View File

@@ -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"}

View 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";
});
}
}