#53: Button ordering issue (Open)

Feb 17 2010 * 23:51
Reported by:   Assigned to:  
Priority: Normal  Milestone:  

When you take some of the buttons out (by setting minimize and maximize to false for example) the updateButtonsOrder would put the remaining close button in buttons2 instead of [r0] which caused a type mismatch error in Enumerable.each. I am testing on IE8 currently, and have not tested on other browsers, but anyway here is the change I made to get around the problem.

  updateButtonsOrder: function() {
    var compareButtons = function(a,b) {
        var c1 = parseInt(a.getStyle("padding-top"));
        var c2 = parseInt(b.getStyle("padding-top"));
        return (c1 < c2 ? -1 : (c2 < c1 ? 1 : 0));
    }
    var buttons = $A(this.buttons.childElements()).sort(compareButtons);
    buttons.each(function(value) { value.setStyle("padding: 0");
    this.buttons.appendChild(value) }, this);
  }