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

Last change on this file since 443 was 443, checked in by hendrikvanantwerpen, 12 years ago

Reorganized for Node --- the SVN gods hate us all!

Lost all historical info on moved files, because SVN is a f *.

Also we have Node now, serving both the static content and forwarding
database requests.

File size: 1018 bytes
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) {
21            var previewItem = new QuestionEditorPreviewItem({
22                id: id,
23                value: item
24            });
25            this.own(previewItem.on('destroy',
26                                    lang.hitch(this,'removeItem',id)));
27            previewItem.startup();
28            return previewItem;
29        }
30    });
31});
Note: See TracBrowser for help on using the repository browser.