Joined: 30 Aug 2005
Posts: 8792
Location: Ultrabubble
Posted: 08/21/13 14:30
I realise that it's only used in a couple of places for the main modules, but why not make the modal form window a core js function, like this:
Code
function jrCore_modal_form(el)
{
$('#' + el).modal({
onOpen: function (dialog) {
dialog.overlay.fadeIn(75, function () {
dialog.container.slideDown(5, function () {
dialog.data.fadeIn(75);
});
});
},
onClose: function (dialog) {
dialog.data.fadeOut('fast', function () {
dialog.container.hide('fast', function () {
dialog.overlay.fadeOut('fast', function () {
$.modal.close();
});
});
});
},
overlayClose:true
});
}
Otherwise it needs to be rewritten in the module js file for each time you might need to use it, or people need to write their own generic function (as above).
function jrCore_modal_form(el,speed) might work if people needed more control over the animation as well.
_________________ Kulshi Mezian!
"Stranger from another planet, welcome to our hole. Just strap on your guitar and we'll play some rock and roll"
Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA
Posted: 08/23/13 15:34
SteveX:
I realise that it's only used in a couple of places for the main modules, but why not make the modal form window a core js function, like this:
Code
function jrCore_modal_form(el)
{
$('#' + el).modal({
onOpen: function (dialog) {
dialog.overlay.fadeIn(75, function () {
dialog.container.slideDown(5, function () {
dialog.data.fadeIn(75);
});
});
},
onClose: function (dialog) {
dialog.data.fadeOut('fast', function () {
dialog.container.hide('fast', function () {
dialog.overlay.fadeOut('fast', function () {
$.modal.close();
});
});
});
},
overlayClose:true
});
}
Otherwise it needs to be rewritten in the module js file for each time you might need to use it, or people need to write their own generic function (as above).
function jrCore_modal_form(el,speed) might work if people needed more control over the animation as well.
The modal window support is already setup for you just by initializing it in the form create. Or are you talking about a "generic" modal window?
Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA
Posted: 08/24/13 12:19
SteveX:
A more generic modal window - but how do you initialise it in the form create?
Yeah it's automatic - I'm not at my system now, but check out the form create array in the view_jrCore_integrity_check function in the core index.php file and you'll see how it is done.