Changeset 1954 for trunk


Ignore:
Timestamp:
2011-09-21 13:47:29 (8 months ago)
Author:
mpo
Message:

fixes #457 and makes the tests run again on IE
This introduces a new property 'allowResize' for selection controls. See #457 for the rationale behind it.

Location:
trunk/modules/kauri-forms/kauri-forms-framework/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/kauri-forms/kauri-forms-framework/src/main/kauri/static-{build}.key/kauri.forms/basic-controls.js

    r1952 r1954  
    261261     
    262262    SelectionControl.prototype.showRefresh = false; 
     263    SelectionControl.prototype.allowResize = true; 
    263264 
    264265    /** Specific control element initialisation */ 
     
    313314     */ 
    314315    SelectionControl.prototype.updateOptions = function( values, userValues, labels) { 
     316         
    315317        values = values || []; 
    316318        labels = labels || userValues; 
     
    322324        var $select = this.getElement(); 
    323325        $select.empty(); // or $select.html(""); 
    324  
     326         
    325327        // loop options from type and construct the inner HTML 
    326328        var last = userValues.length; 
     
    337339        }  
    338340        this.setValue(value, noValidation); 
    339         // on IE we need to trigger repaint by 
    340         $select.blur(); // calling blur 
     341 
     342        // on IE we need to trigger repaint by forcing width manipulation 
     343        // however this reset can be unwanted and therefore overridden through allowResize 
     344        if (this.allowResize) { 
     345            $select.css('width', 0);  
     346            $select.css('width', ''); 
     347        } 
    341348    }; 
    342349 
  • trunk/modules/kauri-forms/kauri-forms-framework/src/test/kauri.forms/test-basic-controls.js

    r1952 r1954  
    293293     
    294294    // #466 : check if rows and cols properties are set correctly 
    295     equal($textarea.attr("cols"), cols,"check cols value"); 
    296     equal($textarea.attr("rows"), rows,"check rows value"); 
     295    equal(Number($textarea.attr("cols")), cols,"check cols value"); 
     296    equal(Number($textarea.attr("rows")), rows,"check rows value"); 
    297297    equal($textarea.attr("readonly"),"readonly","check readonly value") 
    298298 
     
    541541     
    542542    // 2. manually set options uri to options/main.js and call refresh 
     543    var needsWait = true; 
    543544    var opts = c.options; 
    544545    opts.uri = new $.org.kauriproject.UriTemplate("options/main.json", {skipEscape: true}); 
     
    552553        $main.html("").hide(); 
    553554 
    554         start(); 
    555     }); 
    556      
     555        QUnit.start(); 
     556        needsWait = false; 
     557    }); 
     558 
    557559    opts.refresh(); 
    558     stop(); 
     560     
     561    if (needsWait) { // apparently the order of start/stop on IE is different. 
     562        QUnit.stop(); 
     563    } 
    559564     
    560565}); 
Note: See TracChangeset for help on using the changeset viewer.