Changeset 335 for Dev/branches/rest-dojo-ui/client/rft/ui
- Timestamp:
- 05/30/12 16:39:27 (13 years ago)
- Location:
- Dev/branches/rest-dojo-ui/client/rft/ui
- Files:
-
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/LineWithActionsWidgetThijs.js
r333 r335 1 1 define(['dojo/_base/declare','dojo/_base/lang','dojo/on','dojo/dom','dijit/form/Button', 2 2 'dijit/_WidgetBase','dijit/_TemplatedMixin','dijit/_WidgetsInTemplateMixin', 3 'dojo/text!./templates/LineWithActionsWidget.html' ,4 'rft/ui/InlineButton', 'rft/ui/BlockButton'],5 function(declare,lang,on,dom,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString , InlineButton, BlockButton){3 'dojo/text!./templates/LineWithActionsWidget.html' 4 ], 5 function(declare,lang,on,dom,Button,_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin,templateString){ 6 6 return declare('rft.ui.LineWithActionsWidgetThijs',[_WidgetBase,_TemplatedMixin,_WidgetsInTemplateMixin],{ 7 7 templateString: templateString, 8 8 baseClass: 'rftLineWithButtons', 9 9 title: '', 10 color: "blue", 10 11 userObject: null, 11 12 actions: {}, … … 21 22 _setupActions: function() { 22 23 for (var action in this.actions) { 23 new InlineButton({ 24 label: action, 25 iconType: action, 26 highlightColor: "White", 27 onClick: lang.hitch(this, function(){ 28 this.actions[action](this.userObject); 29 }) 30 }).placeAt(this.buttonsNode); 24 25 if (this.actions[action].properties.blockButton == true) { // BlockButton 26 new Button( 27 lang.mixin({ 28 baseClass: 'rftBlockButton', 29 "class": this.color, 30 label: action, 31 iconClass: 'rftIcon rftIcon'+action, 32 title: action, 33 onClick: lang.hitch(this, function(){ 34 this.actions[action].callback(this.userObject); 35 }) 36 }, this.actions[action].properties)).placeAt(this.buttonsNode); 37 } else { //InlineButton 38 new Button( 39 lang.mixin({ 40 baseClass: 'rftInlineButton', 41 "class": "black", 42 showLabel: false, 43 iconClass: 'rftIcon rftIcon'+action, 44 title: action, 45 onClick: lang.hitch(this, function(){ 46 this.actions[action].callback(this.userObject); 47 }) 48 }, this.actions[action].properties)).placeAt(this.buttonsNode); 49 } 50 51 52 53 /* THIS USES DEPRECATED CLASSES!!! 54 if (this.actions[action].blockButton == true) { // BlockButton! 55 new BlockButton({ 56 label: action, 57 iconType: action, 58 highlightColor: this.actions[action].color || "green", 59 onClick: lang.hitch(this, function(){ 60 this.actions[action].callback(this.userObject); 61 }) 62 }).placeAt(this.buttonsNode); 63 64 } else { // InlineButton! 65 new InlineButton({ 66 label: action, 67 iconType: action, 68 highlightColor: "Black", 69 onClick: lang.hitch(this, function(){ 70 this.actions[action].callback(this.userObject); 71 }) 72 }).placeAt(this.buttonsNode); 73 } 74 */ 31 75 } 32 76 }, -
Dev/branches/rest-dojo-ui/client/rft/ui/SelectorThijs.js
r333 r335 8 8 'dijit/_Container', 9 9 './LineWithActionsWidgetThijs', 10 'dojo/text!./templates/Selector .html',10 'dojo/text!./templates/SelectorThijs.html', 11 11 'dojo/dom-class' 12 12 ],function( … … 26 26 title: "The professional as a participant", 27 27 baseClass: 'rftSelector', 28 color: 'red', // This is hardcoded for now, will serve as default value later! (Selector defaults to blue!) Only affects color of lineWithActions 28 29 postCreate: function() { 29 30 var infoFunction = function() { … … 32 33 new LineWithActionsWidget({ 33 34 title: this.title, 35 color: this.color, 34 36 actions: { 35 "Accept" : function(){} 37 "Accept" : { 38 callback: function(arg){}, 39 properties: { 40 blockButton: true, 41 color: this.color 42 } 43 } 36 44 } 37 45 },this.titleNode); 38 46 var selectorLine = new LineWithActionsWidget({ 39 47 title: 'None', 48 color: this.color, 40 49 actions: { 41 "HalfArrowDown" : lang.hitch(this,function(){ 42 var node = this.optionsNode; 43 var show = fx.wipeIn({ 44 node: node 45 }); 46 var hide = fx.wipeOut({ 47 node: node 48 }); 49 hide.play(); 50 var folded = true; 51 return function(e) { 52 if ( folded ) { 53 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 54 var downArrowIcon = dojo.query(".rftInlineButton .rftIconHalfArrowDown", selectorLine.buttonsNode)[0]; // Query the down arrow rftIcon span 55 if (downArrowIcon){ 56 domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown"); 50 "HalfArrowDown" : { 51 callback: lang.hitch(this,function(){ 52 var node = this.optionsNode; 53 var show = fx.wipeIn({ 54 node: node 55 }); 56 var hide = fx.wipeOut({ 57 node: node 58 }); 59 hide.play(); 60 var folded = true; 61 return function(e) { 62 if ( folded ) { 63 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 64 var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", selectorLine.buttonsNode)[0]; // Query the down arrow rftIcon span 65 if (downArrowIcon){ 66 domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown"); 67 } 68 show.play(); 69 folded = false; 70 } else { 71 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 72 var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", selectorLine.buttonsNode)[0]; // Query the up arrow rftIcon span 73 if (upArrowIcon){ 74 domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp"); 75 } 76 hide.play(); 77 folded = true; 78 57 79 } 58 show.play(); 59 folded = false; 60 } else { 61 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 62 var upArrowIcon = dojo.query(".rftInlineButton .rftIconHalfArrowUp", selectorLine.buttonsNode)[0]; // Query the up arrow rftIcon span 63 if (upArrowIcon){ 64 domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp"); 65 } 66 hide.play(); 67 folded = true; 68 69 } 70 e.preventDefault(); 71 e.stopPropagation(); 72 }; 73 })() 80 e.preventDefault(); 81 e.stopPropagation(); 82 }; 83 })(), 84 properties: { 85 blockButton: true, 86 color: this.color, 87 showLabel: false 88 } 89 } 74 90 } 75 91 },this.selectedItemNode); … … 77 93 title: 'Are there direct colleagues among the other participants?', 78 94 actions: { 79 "Inspect" : infoFunction 95 "Inspect" : { 96 callback: infoFunction, 97 properties: { 98 blockButton: false, 99 showLabel: false 100 } 101 } 80 102 } 81 103 }).placeAt(this.optionsNode); 104 /* 82 105 new LineWithActionsWidget({ 83 106 title: 'Do you personally know ithers present at the current session?', … … 92 115 } 93 116 }).placeAt(this.optionsNode); 117 */ 94 118 } 95 119 }); -
Dev/branches/rest-dojo-ui/client/rft/ui/templates/SelectorThijs.html
r333 r335 1 <div> 2 <div class="${baseClass}Title" data-dojo-attach-point="titleNode"></div> 1 <div class="${color}"> 2 <div class="${baseClass}Category"> 3 <div class="${baseClass}Title" data-dojo-attach-point="titleNode"></div> 4 </div> 3 5 <div class="${baseClass}Selected"> 4 6 <div class="${baseClass}Color" data-dojo-attach-point="selectedColorNode"></div>
Note: See TracChangeset
for help on using the changeset viewer.