Ignore:
Timestamp:
07/03/12 16:57:07 (13 years ago)
Author:
hendrikvanantwerpen
Message:

Merge and integrate mockups in proper pages.

File:
1 edited

Legend:

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

    r349 r350  
    55    'dijit/_TemplatedMixin',
    66    'dijit/_WidgetsInTemplateMixin',
    7     'rft/ui/LineWithActionsWidgetThijs',
     7    'rft/ui/LineWithActionsWidget',
    88    'dojo/text!./templates/ObjectBox.html',
    9     ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidgetThijs, template){
     9    ], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, LineWithActionsWidget, template){
    1010        return declare('rft.ui.ObjectBox', [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
    1111            baseClass: "rftObjectBox",
     
    2121            },
    2222            postCreate: function() {
    23                 this.line1 = new LineWithActionsWidgetThijs({
     23                this.line1 = new LineWithActionsWidget({
    2424                    title: this.title || "Untitled",
    2525                    modifiers: 'green',
     
    3535                    }
    3636                }).placeAt(this.line1Node);
    37                 this.line2 = new LineWithActionsWidgetThijs({
     37                this.line2 = new LineWithActionsWidget({
    3838                    title: this.subTitle || "",
    3939                    modifiers: 'green',
     
    4141                }).placeAt(this.line1Node);
    4242                var line3Actions = this._createLine3Actions();
    43                 this.line3 = new LineWithActionsWidgetThijs({
     43                this.line3 = new LineWithActionsWidget({
    4444                    title: this.lowerTitle || "",
    4545                    modifiers: 'green',
     
    101101        },
    102102        _editObject: function(customFunction) {
    103                 // TODO: Pass an edit call to the page script, along with reference to the object contained in this ObjectBox
    104                 alert("Default edit code");
    105                 customFunction();
    106             },
    107             _deleteObject: function(customFunction) {
    108                 // TODO: Pass a delete call to the page script, along with reference to the object contained in this ObjectBox
    109                 customFunction();
    110             },
     103            // TODO: Pass an edit call to the page script, along with reference to the object contained in this ObjectBox
     104            alert("Default edit code");
     105            customFunction();
     106        },
     107        _deleteObject: function(customFunction) {
     108            // TODO: Pass a delete call to the page script, along with reference to the object contained in this ObjectBox
     109            customFunction();
     110        },
    111111           
    112112           
    113             _setTitleAttr: function(value) {
    114                 this.title = value;
    115                 if (this.line1 && this.line1.set) {
    116                     this.line1.set('title', this.title);
    117                 }
    118             },
    119             _setSubTitleAttr: function(value) {
    120                 this.subTitle = value;
    121                 if (this.line2 && this.line2.set) {
    122                     this.line2.set('title', this.subTitle);
    123                 }
    124             },
    125             _setLowerTitleAttr: function(value) {
    126                 this.lowerTitle = value;
    127                 if (this.line3 && this.line3.set) {
    128                     this.line3.set('title', this.lowerTitle);
    129                 }
    130             },
    131             _setObjectTypeAttr: function(value) {
    132                 this.objectType = value;
    133                 this.iconNode.className = "rftIcon typeIcon rftIcon"+this.objectType;
    134             },
     113        _setTitleAttr: function(value) {
     114            this.title = value;
     115            if (this.line1 && this.line1.set) {
     116                this.line1.set('title', this.title);
     117            }
     118        },
     119        _setSubTitleAttr: function(value) {
     120            this.subTitle = value;
     121            if (this.line2 && this.line2.set) {
     122                this.line2.set('title', this.subTitle);
     123            }
     124        },
     125        _setLowerTitleAttr: function(value) {
     126            this.lowerTitle = value;
     127            if (this.line3 && this.line3.set) {
     128                this.line3.set('title', this.lowerTitle);
     129            }
     130        },
     131        _setObjectTypeAttr: function(value) {
     132            this.objectType = value;
     133            this.iconNode.className = "rftIcon typeIcon rftIcon"+this.objectType;
     134        },
    135135
    136             /* This is an experiment to embed the creation function in the ObjectBox class itself. This method cannot be static, but can be called externally as such:
    137              * rft.ui.ObjectBox().CreateNew(args, ref, loc);
    138              * TODO: Check with Hendrik if I should do this or not!
    139              * */
    140              CreateNew: function(arguments, reference, location) {
    141                 var newBox = new rft.ui.ObjectBox(arguments);
    142                 newBox.startup();
    143                 newBox.placeAt(reference, location);
    144             }
    145         });
     136        /* This is an experiment to embed the creation function in the ObjectBox class itself. This method cannot be static, but can be called externally as such:
     137         * rft.ui.ObjectBox().CreateNew(args, ref, loc);
     138         * TODO: Check with Hendrik if I should do this or not!
     139         * */
     140         CreateNew: function(arguments, reference, location) {
     141            var newBox = new rft.ui.ObjectBox(arguments);
     142            newBox.startup();
     143            newBox.placeAt(reference, location);
     144        }
     145    });
    146146});
Note: See TracChangeset for help on using the changeset viewer.