ildar-shaymukhametov_grandnode-refactorings/Grand.Web/Areas/Admin/Views/Document/_CreateOrUpdateDocument.cshtml
@model DocumentModel
<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />
<input asp-for="CustomerId" type="hidden" />

<input id="active-menu-item" type="hidden" value="/@Constants.AreaAdmin/Document/List" />

<admin-tabstrip name="document-edit">
    <items>
        <tabstrip-item text="@T("Admin.Documents.Document.Info")" tab-index="0">
            <content>
                <div>
                    <partial name="_CreateOrUpdateDocument.TabInfo" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Documents.Document.Account")" tab-index="1">
            <content>
                <div>
                    <partial name="_CreateOrUpdateDocument.Account" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Documents.Document.Acl")" tab-index="2">
            <content>
                <div>
                    <partial name="_TabAcl" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Documents.Document.Stores")" tab-index="3">
            <content>
                <div>
                    <partial name="_TabStores" model="Model" />
                </div>
            </content>
        </tabstrip-item>
        <tabstrip-item text="@T("Admin.Common.GenericAttributes.Tab")" tab-index="4">
            <content>
                <div>
                    @{
                        ViewData["ObjectType"] = "Document";
                        ViewData["TabIndex"] = 4;
                    }
                    <partial name="_GenericAttributes" model="Model" view-data="ViewData" />
                </div>
            </content>
        </tabstrip-item>
        <vc:admin-widget widget-zone="document_details_tabs" additional-data="Model" />
    </items>
</admin-tabstrip>

<script>
    $(document).ready(function () {
        $("#@Html.FieldIdFor(model => model.ReferenceId)").change(toggleReferenceType);
        toggleReferenceType();


        function toggleReferenceType() {
            var selectedReferenceId = $("#@Html.FieldIdFor(model => model.ReferenceId)").val();
            if (selectedReferenceId == @(((int) Reference.None).ToString())) {
                $('.object-reference').hide();
            } else {
                $('.object-reference').show();
            }
        }

    });
</script>
