Selaa lähdekoodia

Merge pull request #63 from PhilippSchreiber/master

Fixed bug, when calling lng.Router.article ...
Javier Jiménez 14 vuotta sitten
vanhempi
commit
0c8f8f91f4
1 muutettua tiedostoa jossa 5 lisäystä ja 3 poistoa
  1. 5 3
      src/view/Lungo.View.Article.js

+ 5 - 3
src/view/Lungo.View.Article.js

@@ -24,9 +24,11 @@ LUNGO.View.Article = (function(lng, undefined) {
         _disableNavItems(nav_items);
 
         var current_nav_item = lng.dom(nav_items + '[href="' + article_id + '"]');
-        current_nav_item.addClass(CSS_CLASSES.ACTIVE);
-        _setTitle(section_id, current_nav_item);
-
+        if(current_nav_item.length > 0) {
+            current_nav_item.addClass(CSS_CLASSES.ACTIVE);
+            _setTitle(section_id, current_nav_item);
+        }
+        
         _showContainer(section_id, article_id);
     };