Ignore:
Timestamp:
07/25/12 16:04:02 (13 years ago)
Author:
jkraaijeveld
Message:

Started the QuestionEditorPreview? bit - now works with headers and texts, fully stores and restores this in order properly.

Note: there must be a better way for this, but seeing as all content pieces can differ greatly I couldn't think of a way to make it properly generic. @Hendrik: need discussion about this.

Note2: Currently I don't use any internal events in the question editor. Not sure if it would be a lot better we would.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/rest-dojo-ui/client/rft/ui/QuestionEditorPreview.js

    r366 r376  
    4545                                                item: item
    4646                                        });
    47                                         return {node: previewItem.domNode, data: item, type: "PreviewItem"};
     47                                        return {node: previewItem.domNode, data: previewItem, type: item.type};
    4848                                        break;                                 
    4949                                }                               
     
    5959                                return innerWidget;
    6060                        },
    61                         InsertObjects: function(/*Array*/objects) {
     61                        insertObjects: function(/*Array*/objects) {
    6262                                // This takes an array of objects {data:{//props}, type:[//types]}. Node is NOT included!
    6363                                objects.forEach(function(item){
     
    6565                                }, this);
    6666                        },
    67                         RemoveObject: function(widget) {
     67                        getContent: function() {
     68                                content = [];
     69                                var nodes = this.dndSource.getAllNodes();
     70                                for (var i = 0; i < nodes.length; i++) {
     71                                        content.push(this.dndSource.getItem(nodes[i].id).data.getContent());
     72                                }
     73                                return content;
    6874                        },
    69                         GetNodeList: function() {
     75                        getNodeList: function() {
    7076                                return this.dndSource.getAllNodes();
    7177                        },
Note: See TracChangeset for help on using the changeset viewer.