Merge pull request #3850 from Znow/patch-1

Added onOpen callback, to trigger when the modal opens.
pull/3896/head
Halil İbrahim Kalkan 5 years ago committed by GitHub
commit 81595ee5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
/**
/**
* TODO: Document & prepare typescript definitions
* TODO: Refactor & test more
*/
@ -49,6 +49,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
var _publicApi = null;
var _args = null;
var _onOpenCallbacks = new CallbackList();
var _onCloseCallbacks = new CallbackList();
var _onResultCallbacks = new CallbackList();
@ -106,6 +107,7 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
}
$firstVisibleInput.focus();
_onOpenCallbacks.triggerAll(_publicApi);
});
var modalClass = abp.modals[options.modalClass];
@ -147,6 +149,10 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
_$modal.modal('hide');
};
var _onOpen = function (onOpenCallback) {
_onOpenCallbacks.add(onOpenCallback);
};
var _onClose = function (onCloseCallback) {
_onCloseCallbacks.add(onCloseCallback);
};
@ -188,6 +194,8 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
_onResultCallbacks.triggerAll(_publicApi, arguments);
},
onOpen: _onOpen,
onClose: _onClose,
onResult: _onResult
@ -198,4 +206,4 @@ $.validator.defaults.ignore = ''; //TODO: Would be better if we can apply only f
};
})();
})(jQuery);
})(jQuery);

Loading…
Cancel
Save