| 1 |
define(["dojo/dom", "dojo/_base/connect", "dijit/registry"], |
| 2 |
function(dom, connect, registry){ |
| 3 |
|
| 4 |
var _connectResults = []; |
| 5 |
|
| 6 |
return { |
| 7 |
|
| 8 |
init: function(){ |
| 9 |
currentModel = this.loadedModels.names; |
| 10 |
var connectResult; |
| 11 |
|
| 12 |
var self = this; |
| 13 |
connectResult = connect.connect(dom.byId('testRTL'), "click", function(e){ |
| 14 |
console.log("testRTL called. "); |
| 15 |
|
| 16 |
self.app.domNode.parentNode.dir = "rtl"; |
| 17 |
|
| 18 |
var params = {}; |
| 19 |
var footer = self.app.children.domOrderByConstraint_footer; |
| 20 |
var header = footer.children.domOrderByConstraint_footer_header; |
| 21 |
var right = header.children.domOrderByConstraint_footer_header_right; |
| 22 |
var left = right.children.domOrderByConstraint_footer_header_right_left; |
| 23 |
var center = left.children.domOrderByConstraint_footer_header_right_left_center; |
| 24 |
params.view = header; |
| 25 |
params.parent = footer; |
| 26 |
|
| 27 |
self.app.emit("unload-view", params); |
| 28 |
}); |
| 29 |
_connectResults.push(connectResult); |
| 30 |
|
| 31 |
connectResult = connect.connect(dom.byId('testRTL2'), "click", function(e){ |
| 32 |
console.log("testRTL called. "); |
| 33 |
var params = {}; |
| 34 |
var footer = self.app.children.domOrderByConstraint_footer; |
| 35 |
|
| 36 |
footer.domNode.parentNode.dir = "rtl"; |
| 37 |
|
| 38 |
|
| 39 |
var header = footer.children.domOrderByConstraint_footer_header; |
| 40 |
var right = header.children.domOrderByConstraint_footer_header_right; |
| 41 |
var left = right.children.domOrderByConstraint_footer_header_right_left; |
| 42 |
var center = left.children.domOrderByConstraint_footer_header_right_left_center; |
| 43 |
params.view = header; |
| 44 |
params.parent = footer; |
| 45 |
|
| 46 |
self.app.emit("unload-view", params); |
| 47 |
}); |
| 48 |
_connectResults.push(connectResult); |
| 49 |
|
| 50 |
connectResult = connect.connect(dom.byId('testLTR'), "click", function(e){ |
| 51 |
console.log("testLTR called. "); |
| 52 |
|
| 53 |
self.app.domNode.parentNode.dir = "ltr"; |
| 54 |
|
| 55 |
var params = {}; |
| 56 |
var footer = self.app.children.domOrderByConstraint_footer; |
| 57 |
var header = footer.children.domOrderByConstraint_footer_header; |
| 58 |
var right = header.children.domOrderByConstraint_footer_header_right; |
| 59 |
var left = right.children.domOrderByConstraint_footer_header_right_left; |
| 60 |
var center = left.children.domOrderByConstraint_footer_header_right_left_center; |
| 61 |
params.view = header; |
| 62 |
params.parent = footer; |
| 63 |
|
| 64 |
self.app.emit("unload-view", params); |
| 65 |
}); |
| 66 |
_connectResults.push(connectResult); |
| 67 |
|
| 68 |
connectResult = connect.connect(dom.byId('testLTR2'), "click", function(e){ |
| 69 |
console.log("testLTR called. "); |
| 70 |
var params = {}; |
| 71 |
var footer = self.app.children.domOrderByConstraint_footer; |
| 72 |
|
| 73 |
footer.domNode.parentNode.dir = "ltr"; |
| 74 |
|
| 75 |
|
| 76 |
var header = footer.children.domOrderByConstraint_footer_header; |
| 77 |
var right = header.children.domOrderByConstraint_footer_header_right; |
| 78 |
var left = right.children.domOrderByConstraint_footer_header_right_left; |
| 79 |
var center = left.children.domOrderByConstraint_footer_header_right_left_center; |
| 80 |
params.view = header; |
| 81 |
params.parent = footer; |
| 82 |
|
| 83 |
self.app.emit("unload-view", params); |
| 84 |
}); |
| 85 |
_connectResults.push(connectResult); |
| 86 |
|
| 87 |
connectResult = connect.connect(dom.byId('testTrans'), "click", function(e){ |
| 88 |
console.log("testTrans called. "); |
| 89 |
var params = {}; |
| 90 |
var transOpts = { |
| 91 |
title : "footer,header,right,left,center2", |
| 92 |
target : "footer,header,right,left,center2", |
| 93 |
url : "#footer,header,right,left,center2", |
| 94 |
params : params |
| 95 |
}; |
| 96 |
self.app.transitionToView(e.target,transOpts,e); |
| 97 |
}); |
| 98 |
_connectResults.push(connectResult); |
| 99 |
|
| 100 |
}, |
| 101 |
|
| 102 |
|
| 103 |
destroy: function(){ |
| 104 |
var connectResult = _connectResults.pop(); |
| 105 |
while(connectResult){ |
| 106 |
connect.disconnect(connectResult); |
| 107 |
connectResult = _connectResults.pop(); |
| 108 |
} |
| 109 |
} |
| 110 |
}; |
| 111 |
}); |