|
|
@@ -24,45 +24,15 @@ Lungo.Boot.Section = (function(lng, undefined) {
|
|
|
lng.Fallback.fixPositionInAndroid();
|
|
|
|
|
|
_initFirstSection();
|
|
|
- _initAllSections();
|
|
|
- // _initAllAsides();
|
|
|
};
|
|
|
|
|
|
var _initFirstSection = function() {
|
|
|
- var first_section = lng.Element.Cache.sections.first();
|
|
|
- lng.Element.Cache.section = first_section;
|
|
|
- lng.Element.Cache.article = first_section.children(ELEMENT.ARTICLE).first();
|
|
|
+ var section = lng.Element.Cache.sections.first().addClass(CLASS.SHOW);
|
|
|
+ lng.Element.Cache.section = section;
|
|
|
+ lng.Element.Cache.article = section.children(ELEMENT.ARTICLE + "." + CLASS.ACTIVE);
|
|
|
|
|
|
- var first_section_id = '#' + first_section.attr(ATTRIBUTE.ID);
|
|
|
- first_section.addClass(CLASS.ACTIVE);
|
|
|
- lng.Router.History.add(first_section_id);
|
|
|
- };
|
|
|
-
|
|
|
- var _initAllSections = function() {
|
|
|
- //@todo: position fixed
|
|
|
- //lng.Fallback.positionFixed(lng.Element.Cache.sections);
|
|
|
-
|
|
|
- for (var i = 0, len = lng.Element.Cache.sections.length; i < len; i++) {
|
|
|
- _initArticles(i);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- var _initAllAsides = function() {
|
|
|
- var aside = null;
|
|
|
- for (var i = 0, len = lng.Element.Cache.asides.length; i < len; i++) {
|
|
|
- aside = lng.dom(lng.Element.Cache.asides[i]);
|
|
|
- aside.children(ELEMENT.ARTICLE).addClass(CLASS.ACTIVE);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- var _initArticles = function(section_index) {
|
|
|
- var section = lng.dom(lng.Element.Cache.sections[section_index]);
|
|
|
-
|
|
|
- var first_article = section.children(ELEMENT.ARTICLE).first();
|
|
|
- first_article.addClass(CLASS.ACTIVE);
|
|
|
-
|
|
|
- var first_article_id = first_article.attr(ATTRIBUTE.ID);
|
|
|
- if (first_article_id) lng.View.Article.switchReferenceItems(first_article_id, section);
|
|
|
+ var section_id = '#' + section.attr(ATTRIBUTE.ID);
|
|
|
+ lng.Router.History.add(section_id);
|
|
|
};
|
|
|
|
|
|
var _cacheDOMElements = function() {
|