Forum


HomeHomePremiumPremiumDevelopmentDevelopmentDisplay Edit.ascx in it's own pageDisplay Edit.ascx in it's own page
Previous
 
Next
New Post
8/7/2014 6:15 AM
 

Hi Scott,

I tried the alternative way to generate the url and the module was indeed embedded in the page instead of being a popup.

But unfortunately, it somehow prevented the JQuery initialisation scripts from running which meant my form was unusable.

I don't have time to sort this out now.

What would be useful to know is a way to display the popup window maximised, Then at least the user won't have to do it.
I've detailed my attempt at that earlier in this thread but to no avail.

Steve

 
New Post
12/16/2014 6:37 AM
 

Hi Scott,

I'm looking at this issue again. To save you reading the whole thread again. I'd like to start the edit.ascx in a maximised popup window.

Without debugging the whole lot and guessing, I found a section of code in dnn.modalpopup.js which looks like it will maximise the popup:

if ($modal.data('isMaximized')) {
                            newHeight = $modal.data('height');
                            newWidth = $modal.data('width');
                            $modal.data('isMaximized', false);
                        }

I've changed the call to be:
string[] Params = new string[] { "isMaximized=true", "height=100%", "width=100%", "tid=" + this.ModuleId.ToString() };

 

But it doesn't work.

Do you happen to know how I should call the modal popup? Or how can I debug it to see what's going on? I assume I need to run the debug version of dnn.modalpopup.js. Should  copy the debug version overwriting the minimised copy in the js directory or is there a better way?

 

Please let me know if anything isn't clear.

Best Regards,

Steve

 

 

 
New Post
12/20/2014 1:28 PM
 

Steve,

You can get the un-minified version of the script if you download the source package of DNN.

But I can tell you after looking at it, it's not the best written code.  The isMaximized attribute won't do you much good.  You will have to hook into the function that executes the "maximize" which is the toolbar link at the top of the window.  This is a sample which worked for me.

dnnModal.show('http://730.dnndev.me/TV?popUp=true',false,550,950,false);
$('.dnnToggleMax').trigger('click');

 
New Post
12/21/2014 4:15 AM
 

Hi Scott,

 

Thank you for your reply and for digging out the calls.

 

To save time, i renamed the minified version and copied the unminified version into the js directory. I tried this before but forgot to clear the cache.

 

I tried modifying dnn.modalpopup.js, adding the 'click' to dnntogglemax right after it's defined:

$dnnToggleMax.click(function(e) {
{
 //Code removed for brevity 
});

$('.dnnToggleMax').trigger('click');

 

That works perfectly.

There's a few issues with this though:

1) I don't really want to modify the core code if it can be avoided.

2) The change is of course applied to all modules and I really only want to apply it to the module I'm developing.

 

Is there any way to apply the change on a per module basis?

 

Best Regards,

 

Steve

 
New Post
12/22/2014 12:23 PM
 

Steve,

I agree you shouldn't change core code.  You can either externalize the call to $('.dnnToggleMax').trigger('click'); such that it is called in your module after the dnnModal.show().  Otherwise you can clone the dnnModal script, rename the file and the object, and include it in your module. 

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentDisplay Edit.ascx in it's own pageDisplay Edit.ascx in it's own page



Try FREE
30 days money back guaranteed