mirror of
https://github.com/Codiad/Codiad.git
synced 2026-03-23 17:36:51 +01:00
Allow plugins to define custom load/unload animations for the modal
This commit is contained in:
24
js/modal.js
24
js/modal.js
@@ -29,8 +29,13 @@
|
||||
$('input[autofocus="autofocus"]')
|
||||
.focus();
|
||||
});
|
||||
$('#modal, #modal-overlay')
|
||||
.fadeIn(200);
|
||||
// If a plugin has provided a custom load animation
|
||||
if(typeof codiad.modal.onLoadAnimation == "function") {
|
||||
codiad.modal.onLoadAnimation();
|
||||
} else {
|
||||
$('#modal, #modal-overlay')
|
||||
.fadeIn(200);
|
||||
}
|
||||
codiad.sidebars.modalLock = true;
|
||||
},
|
||||
|
||||
@@ -43,10 +48,17 @@
|
||||
this._setBounds();
|
||||
$('#modal-content form')
|
||||
.die('submit'); // Prevent form bubbling
|
||||
$('#modal, #modal-overlay')
|
||||
.fadeOut(200);
|
||||
$('#modal-content')
|
||||
.html('');
|
||||
// If a plugin has provided a custom unload animation (note
|
||||
// that the custom animation function is responsible for removing
|
||||
// the HTML from the modal)
|
||||
if(typeof codiad.modal.onUnloadAnimation == "function") {
|
||||
codiad.modal.onUnloadAnimation();
|
||||
} else {
|
||||
$('#modal, #modal-overlay')
|
||||
.fadeOut(200);
|
||||
$('#modal-content')
|
||||
.html('');
|
||||
}
|
||||
codiad.sidebars.modalLock = false;
|
||||
if (!codiad.sidebars.leftLock) { // Slide sidebar back
|
||||
$('#sb-left')
|
||||
|
||||
Reference in New Issue
Block a user