Ignore:
Timestamp:
03/13/14 00:44:08 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Added open item options to singe and multiple choice.
  • Question view widgets are forms again, because we needed the control.
  • Multiple and singel choice share their widgets.
  • QuestionEditorPreview? now has items that were already there close, but opens newly dropped items.
  • PreviewItems? will save modified value even when we change to view before the widget loses its focus (which causes a change event).
File:
1 edited

Legend:

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

    r506 r511  
    2626        _onChangeActive: false,
    2727        _onChangeHandle: null,
     28        _fromDrop: true,
    2829        buildRendering: function() {
    2930            this.inherited(arguments);
     
    5253            lang.mixin(sourceParams, {
    5354                accept: [this.type],
    54                 creator: lang.hitch(this, "creator"),
     55                creator: lang.hitch(this,"creator"),
    5556                dropParent: this.containerNode
    5657            });
     
    8283            } else {
    8384                if ( this.createListElement ) {
    84                     nodeOrWidget = this.createListElement(id,item);
     85                    nodeOrWidget = this.createListElement(id,item,this._fromDrop);
    8586                } else {
    8687                    return this.source.defaultCreator(item, hint);
     
    9899        },
    99100        createAvatar: null, /*function(id,item){},*/
    100         createListElement: null, /* function(id,item){},*/
     101        createListElement: null, /* function(id,item,fromDrop){},*/
    101102        _getValueAttr: function() {
    102103            this.value = array.map(this.source.getAllNodes(),function(node){
     
    145146        },
    146147        appendItems: function(items,forceEvent) {
     148            this._fromDrop = false;
    147149            this.source.insertNodes(false,items);
    148150            if ( forceEvent ) { this._handleDrop(); }
     151            this._fromDrop = true;
    149152        },
    150153        appendItem: function(item,forceEvent) {
     154            this._fromDrop = false;
    151155            this.source.insertNodes(false,[item]);
    152156            if ( forceEvent ) { this._handleDrop(); }
     157            this._fromDrop = true;
    153158        },
    154159        removeItem: function(key,forceEvent) {
     
    200205            this._onChange();
    201206        },
    202         _onChange: function(){
     207        _onChange: function() {
    203208            if ( this._onChangeActive &&
    204209                 !(this.readOnly || this.disabled) ) {
Note: See TracChangeset for help on using the changeset viewer.