summaryrefslogtreecommitdiff
path: root/js/dojo/dojox/mobile/TransitionEvent.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/dojo/dojox/mobile/TransitionEvent.js')
-rw-r--r--js/dojo/dojox/mobile/TransitionEvent.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/js/dojo/dojox/mobile/TransitionEvent.js b/js/dojo/dojox/mobile/TransitionEvent.js
new file mode 100644
index 0000000..b2667bf
--- /dev/null
+++ b/js/dojo/dojox/mobile/TransitionEvent.js
@@ -0,0 +1,36 @@
+//>>built
+define("dojox/mobile/TransitionEvent", [
+ "dojo/_base/declare",
+ "dojo/_base/Deferred",
+ "dojo/_base/lang",
+ "dojo/on",
+ "./transition"
+], function(declare, Deferred, lang, on, transitDeferred){
+
+ return declare("dojox.mobile.TransitionEvent", null, {
+ constructor: function(target, transitionOptions, triggerEvent){
+ this.transitionOptions=transitionOptions;
+ this.target = target;
+ this.triggerEvent=triggerEvent||null;
+ },
+
+ dispatch: function(){
+ var opts = {bubbles:true, cancelable:true, detail: this.transitionOptions, triggerEvent: this.triggerEvent};
+ //console.log("Target: ", this.target, " opts: ", opts);
+
+ var evt = on.emit(this.target,"startTransition", opts);
+ //console.log('evt: ', evt);
+ if(evt){
+ Deferred.when(transitDeferred, lang.hitch(this, function(transition){
+ Deferred.when(transition.call(this, evt), lang.hitch(this, function(results){
+ this.endTransition(results);
+ }));
+ }));
+ }
+ },
+
+ endTransition: function(results){
+ on.emit(this.target, "endTransition" , {detail: results.transitionOptions});
+ }
+ });
+});