mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
Improve modality mixin with better $ event usage
This commit is contained in:
parent
06b28991a7
commit
193d6914d6
1 changed files with 5 additions and 5 deletions
|
@ -27,7 +27,7 @@ export default Mixin.create({
|
|||
},
|
||||
|
||||
modalInputFocus(modalId, inputId) {
|
||||
$(modalId).on('shown.bs.modal', function(event) { // eslint-disable-line no-unused-vars
|
||||
$(modalId).one('shown.bs.modal', function(event) { // eslint-disable-line no-unused-vars
|
||||
$(inputId).trigger('focus');
|
||||
});
|
||||
},
|
||||
|
@ -55,7 +55,7 @@ export default Mixin.create({
|
|||
// If caused by a click, the clicked element is available as the relatedTarget
|
||||
// property of the event.
|
||||
modalOnShow(modalId, callback) {
|
||||
$(modalId).on('show.bs.modal', function(e) {
|
||||
$(modalId).one('show.bs.modal', function(e) {
|
||||
callback(e);
|
||||
});
|
||||
},
|
||||
|
@ -64,14 +64,14 @@ export default Mixin.create({
|
|||
// (will wait for CSS transitions to complete). If caused by a click,
|
||||
// the clicked element is available as the relatedTarget property of the event.
|
||||
modalOnShown(modalId, callback) {
|
||||
$(modalId).on('shown.bs.modal', function(e) {
|
||||
$(modalId).one('shown.bs.modal', function(e) {
|
||||
callback(e);
|
||||
});
|
||||
},
|
||||
|
||||
// This event is fired immediately when the hide instance method has been called.
|
||||
modalOnHide(modalId, callback) {
|
||||
$(modalId).on('hide.bs.modal', function(e) {
|
||||
$(modalId).one('hide.bs.modal', function(e) {
|
||||
callback(e);
|
||||
});
|
||||
},
|
||||
|
@ -79,7 +79,7 @@ export default Mixin.create({
|
|||
// This event is fired when the modal has finished being hidden from the user
|
||||
// (will wait for CSS transitions to complete).
|
||||
modalOnHidden(modalId, callback) {
|
||||
$(modalId).on('hidden.bs.modal', function(e) {
|
||||
$(modalId).one('hidden.bs.modal', function(e) {
|
||||
callback(e);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue