From 3aab782e0f05e1f541defe5a00189b44efb808ef Mon Sep 17 00:00:00 2001 From: sudwebdesign Date: Wed, 28 Sep 2016 22:38:17 +0200 Subject: [PATCH] fix toggle no work due an window.opener.document access denied Prevent for continue to interpret javascript if stopping with Error: Permission denied to access property "document" Maybe rule browser "Same-origin policy" or unexisting object. On course sidebar, toggle unwork & print "toggle" in place of + for simply see this (js) error, go to login.php ;-) this function is called in jscript/ATutor_js.php on line 381 ATutor.users.preferences.setStyles() --- jscripts/ATutor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jscripts/ATutor.js b/jscripts/ATutor.js index a9699b479..c213a509d 100644 --- a/jscripts/ATutor.js +++ b/jscripts/ATutor.js @@ -579,7 +579,7 @@ ATutor.users.preferences = ATutor.users.preferences || {}; jQuery('#pref_style').replaceWith(pref_style); if (window.opener) { - jQuery('#pref_style', window.opener.document).replaceWith(pref_style); + try {jQuery('#pref_style', window.opener.document).replaceWith(pref_style);}catch(err){}finally{} } };