Skip to content

Commit

Permalink
Merge pull request #104 from tvdeyen/fix-product-link-tab-select
Browse files Browse the repository at this point in the history
Update product link selection for Alchemy 7.1
  • Loading branch information
tvdeyen authored Jan 2, 2024
2 parents 07bb10d + 7c42dcd commit 3c8e0ff
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/views/alchemy/admin/pages/_product_link_script.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script>
$("#overlay_tabs").on("SelectLinkTab.Alchemy", function(event, data) {
var $tabs = $("#overlay_tabs")

$tabs.on("SelectLinkTab.Alchemy", function(event, data) {
$("#product_link").select2("val", data.link.attr("href"))
})
$("#product_link").alchemyProductSelect({
Expand Down Expand Up @@ -31,9 +33,13 @@
id: Spree.mountedAt() + "products/"+ product.slug,
text: product.name
})
$("#overlay_tabs").tabs("option", "active",
$("#overlay_tabs > div").index($("#overlay_tab_product_link"))
)
if (typeof $tabs.tabs === "function") {
$tabs.tabs("option", "active",
$("#overlay_tabs > div").index($("#overlay_tab_product_link"))
)
} else {
$tabs.get(0).show('overlay_tab_product_link')
}
}
})
},
Expand Down

0 comments on commit 3c8e0ff

Please sign in to comment.