Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r23305: LJINT-491: Commenting system works incor...

Committer: anazarov
LJINT-491: Commenting system works incorrect for side projects
U   branches/r98.4/htdocs/js/basic.js
Modified: branches/r98.4/htdocs/js/basic.js
===================================================================
--- branches/r98.4/htdocs/js/basic.js	2012-11-14 12:33:12 UTC (rev 23304)
+++ branches/r98.4/htdocs/js/basic.js	2012-11-14 13:11:47 UTC (rev 23305)
@@ -150,7 +150,7 @@
  * @return {*} Returns a page variable or undefined if not found.
  */
 LJ.pageVar = function(name, global) {
-	var obj = global ? window.Site : window.Site.page;
+	var obj = global? window.Site : (window.Site || { page: {} }).page;
 
 	if (obj && obj.hasOwnProperty(name)) {
 		return obj[name];
@@ -2346,7 +2346,7 @@
 	// we should run code only when document is ready and only for user
 	// that is not currently logged in
 	$(function () {
-		if (!Site.remoteUser) {
+		if (window.Site && !window.Site.remoteUser) {
 			// wait for API initialization (inside of livejournal.js)
 			setTimeout(methods.get.bind(methods), 0);
 		}

Tags: anazarov, js, livejournal, nfokz
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