Line | |
---|
1 | define(["dojox/mobile/ProgressIndicator"], function(ProgressIndicator){ |
---|
2 | return function(){ |
---|
3 | // the default select_item is 0, or will throw an error if directly transition to #details,EditTodoItem view |
---|
4 | this.selected_item = 0; |
---|
5 | this.selected_configuration_item = 0; |
---|
6 | this.progressIndicator = null; |
---|
7 | /* |
---|
8 | * show or hide global progress indicator |
---|
9 | */ |
---|
10 | |
---|
11 | this.showProgressIndicator = function(show){ |
---|
12 | |
---|
13 | if(!this.progressIndicator){ |
---|
14 | this.progressIndicator = ProgressIndicator.getInstance({removeOnStop:false, startSpinning:true, size:40, center:true, interval:30}); |
---|
15 | // TODO: use dojo.body will throw no appendChild method error. |
---|
16 | var body = document.getElementsByTagName("body")[0]; |
---|
17 | body.appendChild(this.progressIndicator.domNode); |
---|
18 | this.progressIndicator.domNode.style.zIndex = 999; |
---|
19 | } |
---|
20 | if(show){ |
---|
21 | this.progressIndicator.domNode.style.visibility = "visible"; |
---|
22 | this.progressIndicator.start(); |
---|
23 | }else{ |
---|
24 | this.progressIndicator.stop(); |
---|
25 | this.progressIndicator.domNode.style.visibility = "hidden"; |
---|
26 | } |
---|
27 | |
---|
28 | } |
---|
29 | }; |
---|
30 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.