Skip to content

Commit

Permalink
Bug 820778-reopened. Improve Performance in link and import lists of …
Browse files Browse the repository at this point in the history
…friends
  • Loading branch information
jmcanterafonseca committed Dec 19, 2012
1 parent 7867115 commit 2a19461
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 3 additions & 5 deletions apps/communications/contacts/fb_import.html
Expand Up @@ -112,7 +112,7 @@ <h1 data-l10n-id="fbFriends">Facebook Friends</h1>
<p>#email1#</p>
</li>
</ol>
</section> <!-- group template content -->
</section> <!-- group template content -->
</section> <!-- groupsList -->

<form role="dialog" data-type="confirm" class="no-overlay">
Expand All @@ -125,10 +125,9 @@ <h1 data-l10n-id="fbFriends">Facebook Friends</h1>
</button>
</menu>
</form>
</section> <!-- mainContent -->

</section> <!-- mainContent -->

<section id='fixed-container' class='fixed-title-fb'></section>
<section id='fixed-container' class='fixed-title-fb'></section>
</section> <!-- main -->

<section id="search-view" class="view" role="region">
Expand All @@ -153,7 +152,6 @@ <h1 data-l10n-id="fbFriends">Facebook Friends</h1>
<progress class="small"></progress>
</p>
</section>

</section> <!-- search-view section -->

<section id="statusMsg" role="status">
Expand Down
9 changes: 7 additions & 2 deletions apps/communications/contacts/js/fb/friends_list.js
Expand Up @@ -27,6 +27,8 @@ fbFriends.List = (function() {
agroups.forEach(function(group) {
// New element appended
var ele = utils.templates.append(groupsList, {group: group}, fragment);
// This is the <ol> and <header> is children[0]
var list = ele.children[1];

// Array of friends
var friends = groups[group];
Expand All @@ -48,13 +50,16 @@ fbFriends.List = (function() {
friend.search = utils.text.normalize(searchInfo.join(' '));

// New friend appended
utils.templates.append(ele, friend);
// We check wether this friend was in the AB or not before
utils.templates.append(list, friend);
});

// Template is deleted from the list
list.removeChild(list.firstElementChild);
});

groupsList.innerHTML = ''; // Deleting template
groupsList.appendChild(fragment);

FixedHeader.init('#mainContent', '#fixed-container',
'.fb-import-list header');
if (typeof cb === 'function') {
Expand Down

0 comments on commit 2a19461

Please sign in to comment.