Fix extra item removal in ListItemView.

Review Request #8069 — Created March 21, 2016 and submitted

Information

Djblets
release-0.9.x
9ebf0c0...

Reviewers

When an item is being removed because of its destroy signal, we were removing
an extra item as well. What was happening is that the item's view would notice
that its underlying model was destroyed, and it would remove itself. The list
view would then see the removal from the collection, and remove whatever
element was at that same index.

I've changed it so that instead of blindly selecting an element by index, we
instead keep an array of the child views and look up which one needs to be
removed by its model.

Ran js-tests that used this (and were failing before).

reviewbot
  1. Tool: Pyflakes
    Ignored Files:
        djblets/static/djblets/js/configForms/views/listView.js
        djblets/static/djblets/js/configForms/views/listItemView.js
    
    
    
    Tool: PEP8 Style Checker
    Ignored Files:
        djblets/static/djblets/js/configForms/views/listView.js
        djblets/static/djblets/js/configForms/views/listItemView.js
    
    
  2. 
      
brennie
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.9.x (32d0721)