Revision 5f26e13f

b/ui/static/snf/js/ui/web/ui_create_view.js
520 520
                this.add_flavor(flv);
521 521
            }, this));
522 522
            
523
            this.sort_flavors(this.disks);
524
            this.sort_flavors(this.cpus);
525
            this.sort_flavors(this.mems);
526

  
523 527
            var self = this;
524 528
            this.$(".flavor-options li.option").click(function(){
525 529
                var el = $(this);
......
536 540
                self.update_selected_from_ui();
537 541
            })
538 542
        },
543

  
544
        sort_flavors: function(els) {
545
            var prev = undefined;
546
            els.find("li").each(function(i,el){
547
                el = $(el);
548
                if (!prev) { prev = el; return true };
549
                if (el.data("value") < prev.data("value")) {
550
                    prev.before(el);
551
                }
552
                prev = el;
553
            })
554
        },
539 555
        
540 556
        ui_selected: function() {
541 557
            var args = [this.$(".option.cpu.selected").data("value"), 

Also available in: Unified diff