fix javascript for signup modal .click() in index.html for safari
This commit is contained in:
@@ -148,7 +148,26 @@
|
||||
% if show_signup_immediately is not UNDEFINED:
|
||||
<script type="text/javascript">
|
||||
function dosignup(){
|
||||
document.getElementById('signup').click();
|
||||
comp = document.getElementById('signup');
|
||||
try { //in firefox
|
||||
comp.click();
|
||||
return;
|
||||
} catch(ex) {}
|
||||
try { // in old chrome
|
||||
if(document.createEvent) {
|
||||
var e = document.createEvent('MouseEvents');
|
||||
e.initEvent( 'click', true, true );
|
||||
comp.dispatchEvent(e);
|
||||
return;
|
||||
}
|
||||
} catch(ex) {}
|
||||
try { // in IE, safari
|
||||
if(document.createEventObject) {
|
||||
var evObj = document.createEventObject();
|
||||
comp.fireEvent("onclick", evObj);
|
||||
return;
|
||||
}
|
||||
} catch(ex) {}
|
||||
}
|
||||
$(window).load(dosignup);
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user