Ignore:
Timestamp:
07/29/12 00:03:52 (13 years ago)
Author:
hendrikvanantwerpen
Message:
  • Cleanup of the differen ListViews?, List & OrderedList?. Based QuestionListView? on these base classes as well. Removed duplicate code.
  • Destroy busy indicator of TabbedQuestionBrowser? (because it's placed outside of the widgets DOM tree, this is not done automatically).
  • Use dojo/date/stamp module for uniform and parsable date formatting.
  • Added docs/ directory for database format documentation etc.
File:
1 edited

Legend:

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

    r383 r384  
    22    'dojo/_base/declare',
    33    'dojo/_base/lang',
    4     'dijit/_WidgetBase',
    5     'dijit/_TemplatedMixin',
    6     'dijit/_WidgetsInTemplateMixin',
    7     'dijit/_Container',
     4    'dijit/form/Button',
    85    'rft/ui/List',
    96    'dojo/text!./templates/OrderedList.html'
     
    118        declare,
    129        lang,
    13         _WidgetBase,
    14         _TemplatedMixin,
    15         _WidgetsInTemplateMixin,
    16         _Container,
     10        Button,
    1711        List,
    1812        templateString
    1913        ){
    20         return declare('rft.ui.OrderedList',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,_Container,List],{
     14        return declare('rft.ui.OrderedList',[List],{
    2115            templateString: templateString,
    2216            baseClass: 'rftLineListView',
    2317
    2418            postCreate: function() {
    25                 if (this.title) {
    26                     this.titleNode.innerHTML = this.title;
    27                 } else {
    28                     this.domNode.removeChild(this.titleNode);
    29                 }
     19                this.inherited(arguments);
    3020
    31                 this.source = new dojo.dnd.Source(this.sourceNode, {
    32                     isSource: true,
    33                     accept: ["LineListViewItem"],
    34                     horizontal: false,
    35                     withHandles: false,
    36                     copyOnly: false,
    37                     selfCopy: false,
    38                     selfAccept: true,
    39                     delay: 0,
    40                     singular: true,
    41                     creator: lang.hitch(this, this.creatorMethod)
    42                 });
    43 
    44                 new dijit.form.Button({
     21                new Button({
    4522                    label: "Move up",
    4623                    showLabel: false,
     
    4926                    'class': "trans",
    5027                    onClick: lang.hitch(this, function() {
    51                         this.moveItem("up");
     28                        this._moveSelectedItem("up");
    5229                    })
    53                 }, this.btnListMoveUp);
     30                }, this.btnListMoveUp).startup();
    5431
    55                 new dijit.form.Button({
     32                new Button({
    5633                    label: "Move down",
    5734                    showLabel: false,
     
    6037                    'class': "trans",
    6138                    onClick: lang.hitch(this, function() {
    62                         this.moveItem("down");
     39                        this._moveSelectedItem("down");
    6340                    })
    64                 }, this.btnListMoveDown);
     41                }, this.btnListMoveDown).startup();
    6542            },
    6643
    67             moveItem: function(dir) {
     44            _moveSelectedItem: function(dir) {
    6845                var node = this.source.getSelectedNodes()[0];
    6946                if (node) {
     
    9269                var anchor = this.source.getSelectedNodes()[0];
    9370                if (anchor) {
    94                     this.source.insertNodes(false, [item], false, anchor);
     71                    this.source.insertNodes(false,[item], false, anchor);
    9572                } else {
    96                     this.source.insertNodes(false, [item]);
     73                    this.appendItem(item);
    9774                }
    98             },
    99             getItems: function() {
    100                 return this.source.getAllNodes()
    101                 .map(function(node){
    102                     return this.source.getItem(node.id).data;
    103                 },this);
    104             },
     75            }
     76
    10577        });
    10678    });
Note: See TracChangeset for help on using the changeset viewer.