[extensions-web] Sort the local extensions list
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Sort the local extensions list
- Date: Tue, 25 Oct 2011 21:00:24 +0000 (UTC)
commit b9577d61b3838bc1567782a0a963089a873292d0
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Oct 25 16:56:47 2011 -0400
Sort the local extensions list
sweettooth/static/js/extensions.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/static/js/extensions.js b/sweettooth/static/js/extensions.js
index 5037f22..12dd641 100644
--- a/sweettooth/static/js/extensions.js
+++ b/sweettooth/static/js/extensions.js
@@ -145,7 +145,18 @@ function($, messages, dbusProxy) {
var $container = $(this);
dbusProxy.ListExtensions().done(function(extensions) {
if (extensions && Object.keys(extensions).length) {
- $.each(extensions, function(uuid, extension) {
+ var extensionValues = [];
+ for (var uuid in extensions) {
+ extensionValues.push(extensions[uuid]);
+ }
+
+ extensionValues.sort(function(a, b) {
+ return a.name.localeCompare(b.name);
+ });
+
+ extensionValues.forEach(function(extension) {
+ var uuid = extension.uuid;
+
function reinstall() {
dbusProxy.InstallExtension(uuid, $elem.data('pk').toString());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]