mirror of
https://github.com/MailHops/mailhops-plugin.git
synced 2025-05-19 07:40:08 -07:00
Fixed open state of MailHops bar closes #11
This commit is contained in:
parent
536144e304
commit
a8cc84b2f3
@ -54,7 +54,7 @@ mailHops.init = function() {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mailHops.loadPref = function()
|
mailHops.loadPref = function(reload)
|
||||||
{
|
{
|
||||||
mailHops.LOG('load MailHops prefs');
|
mailHops.LOG('load MailHops prefs');
|
||||||
//get preferences
|
//get preferences
|
||||||
@ -86,7 +86,7 @@ mailHops.loadPref = function()
|
|||||||
mailHops.options.country_filter = mailHops.getCharPref('mail.mailHops.country_filter',[]);
|
mailHops.options.country_filter = mailHops.getCharPref('mail.mailHops.country_filter',[]);
|
||||||
|
|
||||||
//init display
|
//init display
|
||||||
mailHopsDisplay.init( mailHops.options );
|
mailHopsDisplay.init( mailHops.options, reload );
|
||||||
};
|
};
|
||||||
|
|
||||||
mailHops.StreamListener =
|
mailHops.StreamListener =
|
||||||
@ -330,7 +330,7 @@ mailHops.unregisterObserver = function(){
|
|||||||
mailHops.observe = function ( aSubject , aTopic , aData )
|
mailHops.observe = function ( aSubject , aTopic , aData )
|
||||||
{
|
{
|
||||||
if ( aTopic == "nsPref:changed" )
|
if ( aTopic == "nsPref:changed" )
|
||||||
mailHops.loadPref();
|
mailHops.loadPref(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
mailHops.getCharPref = function ( strName , strDefault ){
|
mailHops.getCharPref = function ( strName , strDefault ){
|
||||||
|
@ -10,12 +10,13 @@ var mailHopsDisplay =
|
|||||||
mailhopsDataPaneDNSBL: null,
|
mailhopsDataPaneDNSBL: null,
|
||||||
mailhopsResultWeather: null,
|
mailhopsResultWeather: null,
|
||||||
mailhopsUnsubscribe: null,
|
mailhopsUnsubscribe: null,
|
||||||
|
mhBox: null,
|
||||||
options: null,
|
options: null,
|
||||||
|
|
||||||
init: function(options){
|
init: function(options, reload){
|
||||||
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
|
this.mhBox = document.getElementById("mailhopsNoficationBox");
|
||||||
this.container = document.getElementById("mailhopsBox");
|
this.container = document.getElementById("mailhopsBox");
|
||||||
this.resultBox = document.getElementById("mailhopsResult");
|
this.resultBox = document.getElementById("mailhopsResult");
|
||||||
this.resultText = document.getElementById("mailhopsResultText");
|
this.resultText = document.getElementById("mailhopsResultText");
|
||||||
@ -28,6 +29,9 @@ var mailHopsDisplay =
|
|||||||
this.mailhopsDataPaneMailer = document.getElementById("mailhopsDataPaneMailer");
|
this.mailhopsDataPaneMailer = document.getElementById("mailhopsDataPaneMailer");
|
||||||
this.mailhopsDataPaneDNSBL = document.getElementById("mailhopsDataPaneDNSBL");
|
this.mailhopsDataPaneDNSBL = document.getElementById("mailhopsDataPaneDNSBL");
|
||||||
|
|
||||||
|
//wait for message to be selected before showing
|
||||||
|
if(!reload)
|
||||||
|
this.mhBox.style.display = 'none';
|
||||||
|
|
||||||
//event listner for route click to launch map
|
//event listner for route click to launch map
|
||||||
this.mailhopsDataPaneDNSBL.addEventListener("click", function () {
|
this.mailhopsDataPaneDNSBL.addEventListener("click", function () {
|
||||||
@ -44,12 +48,12 @@ var mailHopsDisplay =
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(!!options.bar_color)
|
if(!!options.bar_color)
|
||||||
document.getElementById("mailhopsNoficationBox").style.background = options.bar_color;
|
this.mhBox.style.background = options.bar_color;
|
||||||
else
|
else
|
||||||
document.getElementById("mailhopsNoficationBox").style.background = '';
|
this.mhBox.style.background = '';
|
||||||
|
|
||||||
if(!!options.font_size)
|
if(!!options.font_size)
|
||||||
document.getElementById("mailhopsNoficationBox").style.fontSize = options.font_size;
|
this.mhBox.style.fontSize = options.font_size;
|
||||||
|
|
||||||
if(!!options.font_color){
|
if(!!options.font_color){
|
||||||
this.resultText.style.color = options.font_color;
|
this.resultText.style.color = options.font_color;
|
||||||
@ -192,7 +196,7 @@ var mailHopsDisplay =
|
|||||||
},
|
},
|
||||||
|
|
||||||
clear: function(no_ips){
|
clear: function(no_ips){
|
||||||
|
this.mhBox.style.display = '';
|
||||||
this.mailhopsDataPaneDNSBL.style.display = 'none';
|
this.mailhopsDataPaneDNSBL.style.display = 'none';
|
||||||
this.mailhopsResultWeather.style.display = 'none';
|
this.mailhopsResultWeather.style.display = 'none';
|
||||||
this.resultText.removeAttribute('data-route');
|
this.resultText.removeAttribute('data-route');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user