Browse Source
Merge pull request #25238 from abpframework/fix/cms-kit-replace-ajaxSubmit
Replace `ajaxSubmit` with `abp.ajax` in CmsKit Pages and BlogPosts
pull/25239/head
Enis Necipoglu
3 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
46 additions and
40 deletions
-
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/create.js
-
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/update.js
-
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/create.js
-
modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/Pages/update.js
|
|
|
@ -55,19 +55,20 @@ $(function () { |
|
|
|
|
|
|
|
await submitCoverImage(); |
|
|
|
|
|
|
|
$formCreate.ajaxSubmit({ |
|
|
|
success: function (result) { |
|
|
|
if (isTagsEnabled) { |
|
|
|
submitEntityTags(result.id); |
|
|
|
} |
|
|
|
else { |
|
|
|
finishSaving(); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function (result) { |
|
|
|
abp.notify.error(result.responseJSON.error.message); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
abp.ajax({ |
|
|
|
url: $formCreate.attr("action"), |
|
|
|
data: new FormData($formCreate[0]), |
|
|
|
processData: false, |
|
|
|
contentType: false |
|
|
|
}).done(function (result) { |
|
|
|
if (isTagsEnabled) { |
|
|
|
submitEntityTags(result.id); |
|
|
|
} |
|
|
|
else { |
|
|
|
finishSaving(); |
|
|
|
} |
|
|
|
}).fail(function () { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -42,19 +42,20 @@ $(function () { |
|
|
|
|
|
|
|
await submitCoverImage(); |
|
|
|
|
|
|
|
$formUpdate.ajaxSubmit({ |
|
|
|
success: function (result) { |
|
|
|
if (isTagsEnabled) { |
|
|
|
submitEntityTags($blogPostIdInput.val()); |
|
|
|
} |
|
|
|
else { |
|
|
|
finishSaving(result); |
|
|
|
} |
|
|
|
}, |
|
|
|
error: function (result) { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
abp.notify.error(result.responseJSON.error.message); |
|
|
|
abp.ajax({ |
|
|
|
url: $formUpdate.attr("action"), |
|
|
|
data: new FormData($formUpdate[0]), |
|
|
|
processData: false, |
|
|
|
contentType: false |
|
|
|
}).done(function (result) { |
|
|
|
if (isTagsEnabled) { |
|
|
|
submitEntityTags($blogPostIdInput.val()); |
|
|
|
} |
|
|
|
else { |
|
|
|
finishSaving(result); |
|
|
|
} |
|
|
|
}).fail(function () { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}); |
|
|
|
} |
|
|
|
else { |
|
|
|
|
|
|
|
@ -36,16 +36,16 @@ $(function () { |
|
|
|
$("#ViewModel_Style").val(styleEditor.getValue()); |
|
|
|
$("#ViewModel_Script").val(scriptEditor.getValue()); |
|
|
|
|
|
|
|
$createForm.ajaxSubmit({ |
|
|
|
success: function (result) { |
|
|
|
abp.notify.success(l('SavedSuccessfully')); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
location.href = "../Pages"; |
|
|
|
}, |
|
|
|
error: function (result) { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
abp.notify.error(result.responseJSON.error.message); |
|
|
|
} |
|
|
|
abp.ajax({ |
|
|
|
url: $createForm.attr("action"), |
|
|
|
data: new FormData($createForm[0]), |
|
|
|
processData: false, |
|
|
|
contentType: false |
|
|
|
}).done(function () { |
|
|
|
abp.notify.success(l('SavedSuccessfully')); |
|
|
|
location.href = "../Pages"; |
|
|
|
}).always(function () { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@ -34,12 +34,16 @@ $(function () { |
|
|
|
$("#ViewModel_Style").val(styleEditor.getValue()); |
|
|
|
$("#ViewModel_Script").val(scriptEditor.getValue()); |
|
|
|
|
|
|
|
$formUpdate.ajaxSubmit({ |
|
|
|
success: function (result) { |
|
|
|
abp.notify.success(l('SavedSuccessfully')); |
|
|
|
abp.ui.clearBusy(); |
|
|
|
location.href = "../../Pages"; |
|
|
|
} |
|
|
|
abp.ajax({ |
|
|
|
url: $formUpdate.attr("action"), |
|
|
|
data: new FormData($formUpdate[0]), |
|
|
|
processData: false, |
|
|
|
contentType: false |
|
|
|
}).done(function () { |
|
|
|
abp.notify.success(l('SavedSuccessfully')); |
|
|
|
location.href = "../../Pages"; |
|
|
|
}).always(function () { |
|
|
|
abp.ui.clearBusy(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|