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