penguin/AstroJS

Javascript framework for my blog

commit 22c0e5782e461b5611166a80dd63ba9e83307c69

author斟酌 鵬兄 <tgckpg@gmail.com>
date2015-08-31T07:07:55Z
subjectBug fix for redirecting nulls
commit 22c0e5782e461b5611166a80dd63ba9e83307c69
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2015-08-31T07:07:55Z

    Bug fix for redirecting nulls
---
 botanjs/src/Astro/Blog/Components/VerticalNote.js | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/botanjs/src/Astro/Blog/Components/VerticalNote.js b/botanjs/src/Astro/Blog/Components/VerticalNote.js
index c3ad426..dfa2558 100644
--- a/botanjs/src/Astro/Blog/Components/VerticalNote.js
+++ b/botanjs/src/Astro/Blog/Components/VerticalNote.js
@@ -53,12 +53,15 @@
 
 				formatted.appendChild( nLine );
 
-				formatted.addEventListener(
-					"click"
-					, function( e ) {
-						window.location = this.loc;
-					}.bind({ loc: elem.getDAttribute( "href" ) })
-				);
+				if( elem.getDAttribute( "href" ) )
+				{
+					formatted.addEventListener(
+						"click"
+						, function( e ) {
+							window.location = this.loc;
+						}.bind({ loc: elem.getDAttribute( "href" ) })
+					);
+				}
 
 				len -= opLen;
 			};