mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Added sorting to phone, both moving individual contacts and sorting all at once
This commit is contained in:
@@ -116,9 +116,23 @@ class Phone
|
||||
@contacts.push(contact)
|
||||
end
|
||||
end
|
||||
sort_contacts
|
||||
return true
|
||||
end
|
||||
|
||||
# Rearranges the list of phone contacts to put all visible contacts first,
|
||||
# followed by all invisible contacts.
|
||||
def sort_contacts
|
||||
new_contacts = []
|
||||
2.times do |i|
|
||||
@contacts.each do |con|
|
||||
next if (i == 0 && !con.visible?) || (i == 1 && con.visible?)
|
||||
new_contacts.push(con)
|
||||
end
|
||||
end
|
||||
@contacts = new_contacts
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
# Checks once every second.
|
||||
|
||||
Reference in New Issue
Block a user