Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r19604: LJSUP-8974: RTE: Ability to add and disp...

Committer: vkurkin
LJSUP-8974: RTE: Ability to add and display lj-like buttons
U   trunk/htdocs/js/ck/plugins/livejournal/plugin.js
Modified: trunk/htdocs/js/ck/plugins/livejournal/plugin.js
===================================================================
--- trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-05 04:33:08 UTC (rev 19603)
+++ trunk/htdocs/js/ck/plugins/livejournal/plugin.js	2011-08-05 05:24:25 UTC (rev 19604)
@@ -814,9 +814,9 @@
 							for(var i = 0; i < buttonsLength; i++){
 								var button = likeButtons[i];
 								var input = document.getElementById('like-' + button.abbr);
-								var currentBtn = likeNode.getAttribute('buttons');
-								if((input && input.checked) || (!button.htmlOpt && (currentBtn.indexOf(button.abbr) + 1) || currentBtn.indexOf(button
-									.id) + 1)){
+								var currentBtn = likeNode && likeNode.getAttribute('buttons');
+								if((input && input.checked) || (currentBtn && !button.htmlOpt && (currentBtn.indexOf(button.abbr) + 1 || currentBtn.indexOf(button
+									.id) + 1))){
 									attr.push(button.id);
 									likeHtml += button.html;
 								}

Tags: b_vladi, 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