Commit 59aabfde authored by Leo Iannacone's avatar Leo Iannacone

removed init function (useless) and added header() to show/hide header according with preferences

parent ee9f86a1
......@@ -2,7 +2,7 @@ var socket = io.connect('//' + config.hostname );
var preferences = new Preferences()
new Page_Generic().init(socket)
var page_generic = new Page_Generic(socket)
if (window.location.pathname == config.paths.distribution) {
new Page_Distrubion(socket).start()
......
function Page_Generic()
function Page_Generic(socket)
{
var socket;
var _e = config.events
function __get_status_html(status_package) {
var s = status_package
......@@ -88,10 +88,16 @@ function Page_Generic()
},
}
this.init = function(mysocket) {
var _e = config.events
socket = mysocket
this.header = function() {
if (config.preferences.header) {
$("#pageheader").show()
$(".navbar .home-link").hide()
}
else {
$("#pageheader").hide()
$(".navbar .home-link").show()
}
}
// update distributions
socket.on(_e.broadcast.distributions, function(socket_distributions) {
......@@ -117,5 +123,7 @@ function Page_Generic()
if (window.location.pathname != config.paths.distribution) {
$(".navbar li a[href='" + window.location.pathname + "']").parent().addClass("active")
}
}
this.header()
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment