From 15b1aa47f7098582bb782b7cc1e97058d586d056 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 18 May 2016 21:58:13 +0200 Subject: [PATCH] Correction de 'notif.js' correction --- js/lib/notif-min.js | 2 +- js/lib/notif.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/lib/notif-min.js b/js/lib/notif-min.js index 0127f91..112ab92 100644 --- a/js/lib/notif-min.js +++ b/js/lib/notif-min.js @@ -1,5 +1,5 @@ var NotificationClass=function(a){this.container=a};NotificationClass.prototype={container:this.container,stack:[],types:["warning","info","success","error"],defaultTimeout:2E3,errorCodes:{}};var xxb=null;NotificationClass.prototype.pushStack=function(a,c,b){if(!(a instanceof Array&&b instanceof Array&&c.element instanceof Element))return null;var e=-1,d;for(d in a)if(-1"+c+": "+b+"

";this.container.appendChild(d.element); var f=this.pushStack(this.stack,d,[null]);d.element.id=f;var g=this;d.element.className="notification-element notification-visible";setTimeout(function(){d.element.className="notification-element"},500+e);d.timeout=setTimeout(function(){g.hide(f)},500+e+500);d.element.addEventListener("click",function(a){g.hide(f)},!1);return d.element};NotificationClass.prototype.warning=function(a,c,b){return this.show("warning",a,c,b)}; NotificationClass.prototype.info=function(a,c,b){return this.show("info",a,c,b)};NotificationClass.prototype.success=function(a,c,b){return this.show("success",a,c,b)};NotificationClass.prototype.error=function(a,c,b){return this.show("error",a,c,b)}; diff --git a/js/lib/notif.js b/js/lib/notif.js index b1fb1f0..2276d43 100644 --- a/js/lib/notif.js +++ b/js/lib/notif.js @@ -87,7 +87,7 @@ NotificationClass.prototype.hide = function(id){ /* (1) Suppression de l'élément */ - if( this.stack[id].element instanceof Element ) + if( this.stack[id] != null && this.stack[id].element != null &this.stack[id].element instanceof Element ) this.container.removeChild( this.stack[id].element ); /* (2) On supprime la notification de la pile */