From 2f9b53b045cdbef0f58b5f678dac6adb50dc7506 Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Mon, 10 Oct 2011 01:23:22 -0300 Subject: [PATCH] Fix icon pannel selection. --- mindplot/src/main/javascript/widget/IconPanel.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mindplot/src/main/javascript/widget/IconPanel.js b/mindplot/src/main/javascript/widget/IconPanel.js index 16df019e..3dd72178 100644 --- a/mindplot/src/main/javascript/widget/IconPanel.js +++ b/mindplot/src/main/javascript/widget/IconPanel.js @@ -25,6 +25,9 @@ mindplot.widget.IconPanel = new Class({ buildPanel: function() { var content = new Element('div', {'class':'toolbarPanel','id':'IconsPanel'}); content.setStyles({width:253,height:200,padding:5}); + content.addEvent("click", function(event) { + event.stopPropagation() + }); var count = 0; for (var i = 0; i < mindplot.ImageIcon.prototype.ICON_FAMILIES.length; i = i + 1) { @@ -43,9 +46,11 @@ mindplot.widget.IconPanel = new Class({ }); img.setStyles({width:16,height:16,padding:"0px 2px"}).inject(familyContent); + var panel = this; var model = this.getModel(); - img.addEvent('click', function() { + img.addEvent('click', function(event) { model.setValue(this.id); + panel.hide(); }.bind(img)); count = count + 1;