vincetam2010 / jquery-swip

Automatically exported from code.google.com/p/jquery-swip
0 stars 0 forks source link

functionCallOnClose problem #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setting functionCallOnClose 
2. in file jquery.DOMWindow.js (line 19 and 38) is checked
functionCallOnClose and called functionCallAfterClose
3. functionCallOnClose != functionCallAfterClose 

Anyway, i fixed it but callback function is not called.

Original issue reported on code.google.com by sebasrom...@gmail.com on 6 Oct 2009 at 2:33

GoogleCodeExporter commented 8 years ago
found the same problem, settings are not passed to the callback function. too 
bad...

regards Joachim

Original comment by joachim....@googlemail.com on 30 Oct 2009 at 11:36

GoogleCodeExporter commented 8 years ago
I found the same problem; to fix it, inside the openDOMWindow function I simply
changed all the calls to closeDOMWindow to pass in the functionCallOnClose 
parameter.
ie. $.closeDOMWindow({functionCallOnClose: settings.functionCallOnClose });

I also had to fix the naming of "functionCallOnClose" as mentioned in the first 
comment.

Original comment by steve.kr...@gmail.com on 13 Apr 2010 at 4:41

GoogleCodeExporter commented 8 years ago
Thank you for your fix.
But when I want use $.openDOMWindow as callOnCloseFunction it doesn't work.

WORK :

$.closeDOMWindow({
                functionCallOnClose: function () {
                    alert("test");
                }
});

DONT WORK :

$.closeDOMWindow({
                functionCallOnClose: function () {
                    $.openDOMWindow({ 
                        windowSourceID:'#xxx', 
                        height:690, 
                        width:800, 
                        borderSize:0,
                        overlay:1
                    });
                }
});

Original comment by loic.bis...@gmail.com on 11 Feb 2011 at 6:32

GoogleCodeExporter commented 8 years ago
hi, i am having the same problem..
can you all please post the correct solutions ??
as i had tried what you guys done...
and it not working...
maybe i understand it wrongly.....

Original comment by lawrence...@gmail.com on 29 Apr 2011 at 8:40

GoogleCodeExporter commented 8 years ago
My solution is to set a timer to call another function that call back 
openDOMWindow :

$.closeDOMWindow({
    functionCallOnClose: function () {
        window.setTimeout( "openFunction();",10);
        }
});

function openFunction() {
       $.openDOMWindow({
            windowSourceID:'#xxx', 
        height:690, 
        width:800, 
        borderSize:0,
        overlay:1
     });
}

Original comment by loic.bis...@gmail.com on 30 Aug 2011 at 9:13

GoogleCodeExporter commented 8 years ago
My solution was to edit DOMWindow so when it calls $.closeDOMWindow() it passes 
settings, like $.closeDOMWindow(settings);  This way all the settings from the 
original call are available.  And of course I fixed the typo where the field it 
checks for isn't the field it uses to make the call.

Original comment by dob...@gmail.com on 5 Oct 2011 at 4:39

Attachments: