From ade5a8e596c506b32384739150609defa5a7c703 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Thu, 29 Oct 2009 21:56:10 +0000 Subject: [PATCH] - LSinfosBox : fix bug in addInfo() and add displayInUl() and displayOrAdd() functions --- trunk/includes/js/LSinfosBox.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/trunk/includes/js/LSinfosBox.js b/trunk/includes/js/LSinfosBox.js index 6f83c7e2..c6f04422 100644 --- a/trunk/includes/js/LSinfosBox.js +++ b/trunk/includes/js/LSinfosBox.js @@ -102,8 +102,9 @@ var LSinfosBox = new Class({ addInfo: function(html) { var ul = this.content.getLast("ul"); - var add = 0; + var add = 1; if (!$type(ul)) { + add=0; ul = new Element('ul'); if (this.content.innerHTML!="") { var c_li = new Element('li'); @@ -131,5 +132,24 @@ var LSinfosBox = new Class({ this.content.set('html',html); } this.open(); + }, + + displayInUl: function(html) { + if ($type(html)) { + ul = new Element('ul'); + this.content.empty(); + ul.set('html',html); + ul.inject(this.content); + } + this.open(); + }, + + displayOrAdd: function(html) { + if (this.isOpened()) { + this.addInfo(html); + } + else { + this.displayInUl(html); + } } });