From c0bf2e64ff15b3a1c79ab8413b38d67eae0d4a2f Mon Sep 17 00:00:00 2001 From: Val Erastov Date: Mon, 9 Feb 2015 21:24:37 -0800 Subject: [PATCH] fix bugs in constraints list --- web/app/ui.js | 8 +++++--- web/sketcher.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/app/ui.js b/web/app/ui.js index 37d19550..0c0503c1 100644 --- a/web/app/ui.js +++ b/web/app/ui.js @@ -56,8 +56,10 @@ TCAD.ui.List.prototype.refresh = function() { var model = this.model; for (var i = 0; i < items.length; ++i) { var item = items[i]; - this.ul.append(this.template.replace('$name$', item.name)); - this.ul.find('li:last input').click(function() {model.remove(item, i)}); - this.ul.find('li:last').hover(function() {model.hover(item, i)}); + var li = $(this.template.replace('$name$', item.name)); + this.ul.append(li); + var index = i; + li.find('.ui-rm').click(function() {model.remove(item, index)}); + li.hover(function() {model.hover(item, index)}); } }; \ No newline at end of file diff --git a/web/sketcher.html b/web/sketcher.html index eee4dcd0..e6678b82 100644 --- a/web/sketcher.html +++ b/web/sketcher.html @@ -270,7 +270,7 @@
CONSTRAINTS