Changeset 354 for Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js
- Timestamp:
- 07/09/12 19:24:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/ui/Selector.js
r350 r354 26 26 title: "The professional as a participant", 27 27 baseClass: 'rftSelector', 28 modifiers: 'blue', // Extra CSS classes28 modifiers: 'blue', 29 29 postCreate: function() { 30 30 domClass.add(this.domNode, this.modifiers); 31 31 domClass.add(this.selectedColorNode, "pending"); 32 var infoFunction = function() { 33 alert("Show info here"); 34 } 32 35 33 new LineWithActionsWidget({ 36 34 title: this.title, … … 48 46 } 49 47 },this.titleNode); 50 var selectorLine = new LineWithActionsWidget({ 48 49 this.selectorLine = new LineWithActionsWidget({ 51 50 title: 'None', 52 51 modifiers: this.modifiers, 53 52 actions: { 54 53 "ToggleDropdown" : { 55 callback: lang.hitch(this,function(){ 56 var node = this.optionsNode; 57 var show = fx.wipeIn({ 58 node: node 59 }); 60 var hide = fx.wipeOut({ 61 node: node 62 }); 63 hide.play(); 64 var folded = true; 65 return function(e) { 66 if ( folded ) { 67 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 68 var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", selectorLine.buttonsNode)[0]; // Query the down arrow rftIcon span 69 if (downArrowIcon){ 70 domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown"); 71 } 72 show.play(); 73 folded = false; 74 } else { 75 // Bit of an ugly solution, really. Limit workload by limiting search to child elements of selecorLine.buttonsNode 76 var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", selectorLine.buttonsNode)[0]; // Query the up arrow rftIcon span 77 if (upArrowIcon){ 78 domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp"); 79 } 80 hide.play(); 81 folded = true; 82 83 } 84 e.preventDefault(); 85 e.stopPropagation(); 86 }; 87 })(), 54 callback: lang.hitch(this, this._toggleDropdown()), 88 55 properties: { 89 56 blockButton: true, … … 95 62 } 96 63 },this.selectedItemNode); 64 }, 65 _toggleDropdown: function(selectorLine) { 66 var node = this.optionsNode; 67 var show = fx.wipeIn({ 68 node: node 69 }); 70 var hide = fx.wipeOut({ 71 node: node 72 }); 73 hide.play(); 74 var folded = true; 75 return function(e) { 76 if ( folded ) { 77 var downArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowDown", this.selectorLine.buttonsNode)[0]; 78 if (downArrowIcon){ 79 domClass.replace(downArrowIcon, "rftIconHalfArrowUp", "rftIconHalfArrowDown"); 80 } 81 show.play(); 82 folded = false; 83 } else { 84 var upArrowIcon = dojo.query(".rftBlockButton .rftIconHalfArrowUp", this.selectorLine.buttonsNode)[0]; 85 if (upArrowIcon){ 86 domClass.replace(upArrowIcon, "rftIconHalfArrowDown", "rftIconHalfArrowUp"); 87 } 88 hide.play(); 89 folded = true; 90 91 } 92 e.preventDefault(); 93 e.stopPropagation(); 94 }; 95 }, 96 addQuestion: function(question) { 97 97 new LineWithActionsWidget({ 98 title: 'Are there direct colleagues among the other participants?', 98 title: question.title, 99 question: question, 99 100 actions: { 100 101 "InfoHover" : { 101 callback: infoFunction,102 callback: this.infoFunction, 102 103 properties: { 103 104 blockButton: false, … … 108 109 } 109 110 }).placeAt(this.optionsNode); 111 }, 112 infoFunction: function(){ 113 alert("Some info here!");text 110 114 } 111 115 }); 112 116 });
Note: See TracChangeset
for help on using the changeset viewer.