source: Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreview.js

Last change on this file was 511, checked in by hendrikvanantwerpen, 11 years ago
  • 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 size: 1.1 KB
Line 
1define([
2    "../../widgets/ListWidget",
3    "./QuestionEditorPreviewItem",
4    "dijit/registry",
5    "dojo/_base/array",
6    "dojo/_base/declare",
7    "dojo/_base/lang",
8    "dojo/dom-construct"
9], function(ListWidget, QuestionEditorPreviewItem, registry, array, declare, lang, domConstruct) {
10    return declare([ListWidget], {
11        baseClass: 'surveyEditorPreview',
12        type: 'questionContent',
13        withHandles: true,
14
15        createAvatar: function(id, item) {
16            return domConstruct.create("div",{
17                innerHTML: item.type || "(unkown)"
18            });
19        },
20        createListElement: function(id, item, fromDrop) {
21            var previewItem = new QuestionEditorPreviewItem({
22                id: id,
23                value: item
24            });
25            previewItem.startup();
26            if ( fromDrop ) { previewItem.showEdit(); }
27            this.own(previewItem.on('destroy',
28                                    lang.hitch(this,'removeItem',id,true)));
29            return previewItem;
30        }
31    });
32});
Note: See TracBrowser for help on using the repository browser.