Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize refreshing of objects' list #104

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions annotationTools/js/edit_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ function StopEditEvent() {
}
}

// Render the object list:
if(view_ObjList) {
RenderObjectList();
}
console.log('LabelMe: Stopped edit event.');
}

Expand Down
4 changes: 2 additions & 2 deletions annotationTools/js/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function handler() {

// Refresh object list:
if(view_ObjList) {
RenderObjectList();
UpdateObjectList(false, anno.anno_id, new_name);
ChangeLinkColorFG(anno.GetAnnoID());
}
};
Expand Down Expand Up @@ -145,7 +145,7 @@ function handler() {
WriteXML(SubmitXmlUrl,LM_xml,function(){return;});

// Refresh object list:
if(view_ObjList) RenderObjectList();
if(view_ObjList) UpdateObjectList(true, idx);
selected_poly = -1;
unselectObjects(); // Perhaps this should go elsewhere...
StopEditEvent();
Expand Down
7 changes: 7 additions & 0 deletions annotationTools/js/object_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
var IsHidingAllPolygons = false;
var ListOffSet = 0;

function UpdateObjectList(deleted, idx, new_name) {
if (deleted)
$('#anno_list #LinkAnchor' + idx).empty();
if (new_name != 'undefined')
$('#anno_list #LinkAnchor'+idx+ ' #Link'+ idx).text(new_name);
}

// This function creates and populates the list
function RenderObjectList() {
// If object list has been rendered, then remove it:
Expand Down