Skip to content

Commit

Permalink
better js
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed Dec 20, 2024
1 parent ed900d9 commit cb2e40c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace OrchardCore.AdminMenu.Services;

[Obsolete("This service is obsolete and will be removed in version 4. Instead, please use IPermissionService")]
public sealed class AdminMenuPermissionService : IAdminMenuPermissionService
{
private readonly IEnumerable<IPermissionProvider> _permissionProviders;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,19 @@
<div class="mb-3">
<div class="w-xl-50">
<input asp-for="SelectedPermissionNames" type="hidden" v-model="selectedNames" />
<vue-multiselect v-model="value"
:options="options"
track-by="name"
label="displayText"
placeholder="@T["Type to search"]"
@@select="onSelect"
:searchable="true"
:close-on-select="true"
:reset-after="true"
:show-labels="true"
:hide-selected="false"
select-label="@T["Select"]"
deselect-label="@T["Remove"]">
<vue-multiselect v-model="value"
:options="options"
track-by="name"
label="displayText"
placeholder="@T["Type to search"]"
@@select="onSelect"
:searchable="true"
:close-on-select="true"
:reset-after="true"
:show-labels="true"
:hide-selected="false"
select-label="@T["Select"]"
deselect-label="@T["Remove"]">
<template slot="option" slot-scope="props">
<div v-cloak><span>{{ props.option.displayText }}</span></div>
</template>
Expand All @@ -137,7 +137,11 @@
</div>
</div>
</div>
<script at="Foot" depends-on="admin-menu-permission-picker">initAdminMenuPermissionsPicker(document.querySelector("#PermissionPicker"))</script>
<script at="Foot" depends-on="admin-menu-permission-picker">
document.addEventListener('DOMContentLoaded', () => {
initAdminMenuPermissionsPicker(document.querySelector("#PermissionPicker"));
});
</script>
</div>

<script at="Foot">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@
</div>
</div>
</div>
<script at="Foot" depends-on="admin-menu-permission-picker">initAdminMenuPermissionsPicker(document.querySelector("#PermissionPicker"))</script>
<script at="Foot" depends-on="admin-menu-permission-picker">
document.addEventListener('DOMContentLoaded', () => {
initAdminMenuPermissionsPicker(document.querySelector("#PermissionPicker"))
});
</script>
</div>

<script at="Foot">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,8 @@
</div>
</div>

<script at="Foot" depends-on="admin-permission-picker,vuejs">initMenuPermissionsPicker(document.querySelector("#PermissionPicker"))</script>
<script at="Foot" depends-on="menu-permission-picker,vuejs">
document.addEventListener('DOMContentLoaded', () => {
initMenuPermissionsPicker(document.querySelector("#PermissionPicker"))
});
</script>

0 comments on commit cb2e40c

Please sign in to comment.