changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r17713: LJSUP-7374: fixed error when clicking on...

Committer: dpetrov
LJSUP-7374: fixed error when clicking on tab that is not accessible yet
U   trunk/htdocs/stc/fck/editor/dialog/fck_image/fck_image.js
Modified: trunk/htdocs/stc/fck/editor/dialog/fck_image/fck_image.js
===================================================================
--- trunk/htdocs/stc/fck/editor/dialog/fck_image/fck_image.js	2010-11-18 03:58:34 UTC (rev 17712)
+++ trunk/htdocs/stc/fck/editor/dialog/fck_image/fck_image.js	2010-11-18 05:05:16 UTC (rev 17713)
@@ -52,11 +52,16 @@
 // Function called when a dialog tag is selected.
 function OnDialogTabChange( tabCode )
 {
-	ShowE('divInfo'		, ( tabCode == 'Info' ) ) ;
-	ShowE('divLink'		, ( tabCode == 'Link' ) ) ;
-	ShowE('divUpload'	, ( tabCode == 'Upload' ) ) ;
-  ShowE('divPhotobucket', ( tabCode == 'Photobucket' ) ) ;
-	ShowE('divAdvanced'	, ( tabCode == 'Advanced' ) ) ;
+	try {
+		ShowE('divInfo'		, ( tabCode == 'Info' ) ) ;
+		ShowE('divLink'		, ( tabCode == 'Link' ) ) ;
+		ShowE('divUpload'	, ( tabCode == 'Upload' ) ) ;
+		ShowE('divPhotobucket', ( tabCode == 'Photobucket' ) ) ;
+		ShowE('divAdvanced'	, ( tabCode == 'Advanced' ) ) ;
+	} catch( e ) {
+		//it may happen, that tabs are not loaded in dom yet, so we will wait a little and repeat
+		setTimeout( function() { OnDialogTabChange( tabCode ); }, 0 );
+	}
 }
 
 // Get the selected image (if available).

Tags: changelog_bot, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments