fix bugs in constraints list

This commit is contained in:
Val Erastov 2015-02-09 21:24:37 -08:00
parent 61c42e0906
commit c0bf2e64ff
2 changed files with 6 additions and 4 deletions

View file

@ -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)});
}
};

View file

@ -270,7 +270,7 @@
<div class="panel b-right scroll" style="float: left; width: 245px; height: 100%;">
<div class="tool-caption">CONSTRAINTS</div>
<ul class="tlist" id='constrs'>
<li>$name$<span class="rm" style="float: right;"><input class="btn sbtn" style="" type="submit" value="✘"></span></li>
<li>$name$<span class="rm" style="float: right;"><input class="btn sbtn ui-rm" style="" type="submit" value="✘"></span></li>
</ul>
</div>
<div style="background: black; float: left; width: calc(100% - 298px); height: 100%;">