Przeglądaj źródła

Fix error in router.article method

Javi Jimenez Villar 13 lat temu
rodzic
commit
8d9b30806a
1 zmienionych plików z 2 dodań i 3 usunięć
  1. 2 3
      src/modules/Lungo.Router.coffee

+ 2 - 3
src/modules/Lungo.Router.coffee

@@ -42,12 +42,11 @@ Lungo.Router = do(lng = Lungo) ->
   @param    {string} <article> Id
   @param    {string} <article> Id
   ###
   ###
   article = (section_id, article_id, element) ->
   article = (section_id, article_id, element) ->
-    current = lng.Element.Cache.article
-    if _notCurrentTarget(current, article_id)
+    if _notCurrentTarget(lng.Element.Cache.article, article_id)
       lng.Router.section section_id
       lng.Router.section section_id
       target = lng.Element.Cache.section.find "##{article_id}"
       target = lng.Element.Cache.section.find "##{article_id}"
       if target.length > 0
       if target.length > 0
-        current.removeClass(C.CLASS.ACTIVE).trigger C.TRIGGER.UNLOAD
+        lng.Element.Cache.article.removeClass(C.CLASS.ACTIVE).trigger C.TRIGGER.UNLOAD
         lng.Element.Cache.article = target.addClass(C.CLASS.ACTIVE).trigger(C.TRIGGER.LOAD)
         lng.Element.Cache.article = target.addClass(C.CLASS.ACTIVE).trigger(C.TRIGGER.LOAD)
         if element?.data(C.ATTRIBUTE.TITLE)?
         if element?.data(C.ATTRIBUTE.TITLE)?
           lng.Element.Cache.section.find(C.QUERY.TITLE).text element.data(C.ATTRIBUTE.TITLE)
           lng.Element.Cache.section.find(C.QUERY.TITLE).text element.data(C.ATTRIBUTE.TITLE)