@{
    Layout = "";
}
@model SpecificationAttributeOptionModel
@{    
    //page title
    ViewBag.Title = Loc["Admin.Catalog.Attributes.SpecificationAttributes.Options.EditOptionDetails"];
}
<form asp-area="@Constants.AreaAdmin" asp-controller="SpecificationAttribute" asp-action="OptionEditPopup" method="post" id="specificationattribute-form"
      asp-route-SpecificationAttributeId="@Context.Request.Query["SpecificationAttributeId"]">

    <div class="row">
        <div class="col-md-12">
            <div class="x_panel light form-fit">
                <div class="x_title">
                    <div class="caption">
                        <i class="fa fa-list-alt"></i>
                        @Loc["Admin.Catalog.Attributes.SpecificationAttributes.Options.EditOptionDetails"]
                    </div>
                </div>
                <div class="x_content form">
                    <partial name="Partials/CreateOrUpdateOption" model="Model" />
                </div>
            </div>
        </div>
    </div>
    <script>
        var mfp = $.magnificPopup.instance;
        $("#specificationattribute-form").submit(function (e) {
            e.preventDefault();
            var form = $(this);
            var url = form.attr('action');
            $.ajax({
                type: "POST",
                url: url,
                data: form.serialize(),
                success: function (data) {
                    if (data == "") {
                        mfp.close();
                        $('#btnRefresh').click();
                    } else {
                        $.magnificPopup.open({
                            items: {
                                src: data,
                                type: 'inline'
                            },
                            callbacks: {
                                open: function () {
                                    $('.mfp-wrap').removeAttr('tabindex');
                                }
                            }
                        });
                    }
                }
            });
        });
    </script>
</form>