/** * Handles the and to show * * @namespace LUNGO * @class Router * * @author Javier Jimenez Villar || @soyjavi * @author Guillermo Pascual || @pasku1 */ LUNGO.Router = (function(lng, undefined) { var CSS_CLASSES = { SHOW: 'show', HIDE: 'hide', ACTIVE: 'current' }; /** * Navigate to a
. * * @method section * * @param {string} Id of the
*/ var section = function(section_id) { var section_id = (section_id.indexOf('#')) ? '#' + section_id : section_id; var target = 'section' + section_id; if (_existsTarget(target)) { lng.dom(_getHistoryCurrent()).removeClass(CSS_CLASSES.SHOW).addClass(CSS_CLASSES.HIDE); lng.dom(target).addClass(CSS_CLASSES.SHOW).trigger('load'); lng.Router.History.add(section_id); } }; /** * Displays the
in a particular
. * * @method article * * @param {string}
Id * @param {string}
Id */ var article = function(section_id, article_id) { var target = section_id + ' article' + article_id; if (_existsTarget(target)) { lng.View.Article.show(section_id, article_id); } }; /** * Displays the