Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #63 #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/assets/ModalRemote.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ function ModalRemote(modalId) {
* @param {string} method The method of request
* @param {object}data of request
*/
this.doRemote = function (url, method, data) {
this.doRemote = function (url, method, data, isAsync = false) {
var instance = this;
$.ajax({
url: url,
method: method,
data: data,
async: false,
async: isAsync,
beforeSend: function () {
beforeRemoteRequest.call(instance);
},
Expand Down Expand Up @@ -294,7 +294,7 @@ function ModalRemote(modalId) {
* @param {string} dataRequestMethod POST or GET
* @param {number[]} selectedIds
*/
this.confirmModal = function (title, message, okLabel, cancelLabel, size, dataUrl, dataRequestMethod, selectedIds) {
this.confirmModal = function (title, message, okLabel, cancelLabel, size, dataUrl, dataRequestMethod, selectedIds, isAsync) {
this.show();
this.setSize(size);

Expand Down Expand Up @@ -329,7 +329,8 @@ function ModalRemote(modalId) {
instance.doRemote(
dataUrl,
dataRequestMethod,
data
data,
isAsync
);
}
);
Expand Down Expand Up @@ -378,13 +379,15 @@ function ModalRemote(modalId) {
$(elm).hasAttr('data-modal-size') ? $(elm).attr('data-modal-size') : 'normal',
$(elm).hasAttr('href') ? $(elm).attr('href') : $(elm).attr('data-url'),
$(elm).hasAttr('data-request-method') ? $(elm).attr('data-request-method') : 'GET',
bulkData
bulkData,
$(elm).hasAttr('data-request-async') ? $(elm).attr('data-request-async') !== 'false' : null
)
} else {
this.doRemote(
$(elm).hasAttr('href') ? $(elm).attr('href') : $(elm).attr('data-url'),
$(elm).hasAttr('data-request-method') ? $(elm).attr('data-request-method') : 'GET',
bulkData
bulkData,
$(elm).hasAttr('data-request-async') ? $(elm).attr('data-request-async') !== 'false' : null
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ModalRemote.min.js
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.