Ignore:
Timestamp:
03/11/14 22:45:58 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Added subcodes to schema and config widgets.
  • Disallow empty strings in schema and strip objects before sending them to the server.
  • Finally managed proper change events in lists and complexvalues.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js

    r500 r506  
    1515        readOnly: false,
    1616        _onChangeActive: false,
     17        _onChangeHandle: null,
    1718        constructor: function() {
    1819            this._listenerMap = {};
     
    9899        _handleChange: function(evt) {
    99100            if ( evt.target !== this.domNode ) {
    100                 if ( this._onChangeActive && !(this.readOnly || this.disabled) ) {
    101                     this.emit('change',this.get('value'));
     101                if ( this._onChangeActive &&
     102                     !(this.readOnly || this.disabled) ) {
     103                    if ( this._onChangeHandle ) {
     104                        this._onChangeHandle.cancel();
     105                    }
     106                    this._onChangeHandle = this.defer(function(){
     107                        this._onChangeHandle = null;
     108                        on.emit(this.domNode,'change',{
     109                            target: this.domNode,
     110                            value: this.get('value'),
     111                            bubbles: true,
     112                            cancellable: true
     113                        });
     114                    });
    102115                }
    103116                if ( evt ) { event.stop(evt); }
    104117                return false;
     118            } else {
     119                return evt;
    105120            }
    106             return true;
    107121        },
    108122        _handleSubmit: function(evt) {
Note: See TracChangeset for help on using the changeset viewer.