Commit f7cd47dd authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Proper flavor sorting, Refs #1429

parent 5385ea5e
......@@ -520,6 +520,10 @@
this.add_flavor(flv);
}, this));
this.sort_flavors(this.disks);
this.sort_flavors(this.cpus);
this.sort_flavors(this.mems);
var self = this;
this.$(".flavor-options li.option").click(function(){
var el = $(this);
......@@ -536,6 +540,18 @@
self.update_selected_from_ui();
})
},
sort_flavors: function(els) {
var prev = undefined;
els.find("li").each(function(i,el){
el = $(el);
if (!prev) { prev = el; return true };
if (el.data("value") < prev.data("value")) {
prev.before(el);
}
prev = el;
})
},
ui_selected: function() {
var args = [this.$(".option.cpu.selected").data("value"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment