Explorar o código

! stop unnecessary calls to action=jsoption on page load when an element is toggled off (thanks emanuele)

Spuds %!s(int64=13) %!d(string=hai) anos
pai
achega
ca36576949
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Themes/default/scripts/script.js

+ 1 - 1
Themes/default/scripts/script.js

@@ -886,7 +886,7 @@ smc_Toggle.prototype.changeState = function(bCollapse, bInit)
 	if ('oCookieOptions' in this.opt && this.opt.oCookieOptions.bUseCookie)
 		this.oCookie.set(this.opt.oCookieOptions.sCookieName, this.bCollapsed ? '1' : '0');
 
-	if ('oThemeOptions' in this.opt && this.opt.oThemeOptions.bUseThemeSettings)
+	if (!bInit && 'oThemeOptions' in this.opt && this.opt.oThemeOptions.bUseThemeSettings)
 		smf_setThemeOption(this.opt.oThemeOptions.sOptionName, this.bCollapsed ? '1' : '0', 'sThemeId' in this.opt.oThemeOptions ? this.opt.oThemeOptions.sThemeId : null, smf_session_id, smf_session_var, 'sAdditionalVars' in this.opt.oThemeOptions ? this.opt.oThemeOptions.sAdditionalVars : null);
 }