Line | |
---|
1 | define([ |
---|
2 | "dojo/dom", |
---|
3 | "dojo/json", |
---|
4 | "dijit/registry" |
---|
5 | ], function(dom, json, registry){ |
---|
6 | // module: |
---|
7 | // dojox/mvc/tests/mobile/demo/MobileDemoGenerateActions |
---|
8 | // summary: |
---|
9 | // The action handlers for Generate example of this demo. |
---|
10 | |
---|
11 | return { |
---|
12 | switchToData: function(){ |
---|
13 | // summary: |
---|
14 | // Called when the "Update Model" button is pressed on the Generate View page. |
---|
15 | |
---|
16 | dom.byId("outerModelArea").style.display = ""; |
---|
17 | try { |
---|
18 | dom.byId("modelArea").focus(); // hack: do this to force focus off of the textbox, bug on mobile? |
---|
19 | dom.byId("viewArea").style.display = "none"; |
---|
20 | registry.byId("modelArea").set("value", json.stringify(registry.byId("view").get("children"))); |
---|
21 | } catch(e) { |
---|
22 | console.log(e); |
---|
23 | } |
---|
24 | }, |
---|
25 | |
---|
26 | switchToGenerated: function(){ |
---|
27 | // summary: |
---|
28 | // Called when the "Update View" button is pressed on the Generate Simple Form. |
---|
29 | |
---|
30 | dom.byId("outerModelArea").style.display = "none"; |
---|
31 | dom.byId("viewArea").style.display = ""; |
---|
32 | } |
---|
33 | }; |
---|
34 | }); |
---|
35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.