123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- define("dojox/mobile/_ItemBase", [
- "dojo/_base/kernel",
- "dojo/_base/config",
- "dojo/_base/declare",
- "dijit/registry",
- "dijit/_Contained",
- "dijit/_Container",
- "dijit/_WidgetBase",
- "./TransitionEvent",
- "./View"
- ], function(kernel, config, declare, registry, Contained, Container, WidgetBase, TransitionEvent, View){
-
-
-
-
- return declare("dojox.mobile._ItemBase", [WidgetBase, Container, Contained],{
-
-
-
-
-
-
-
-
-
- icon: "",
-
-
-
-
-
- iconPos: "",
-
-
- alt: "",
-
-
- href: "",
-
-
-
-
- hrefTarget: "",
-
-
-
-
-
-
-
-
-
-
-
-
-
- moveTo: "",
-
-
- scene: "",
-
-
-
- clickable: false,
-
-
-
-
-
-
- url: "",
-
-
-
-
- urlTarget: "",
-
-
-
-
-
-
-
- transition: "",
-
-
-
-
-
- transitionDir: 1,
-
-
- transitionOptions: null,
-
-
-
-
- callback: null,
-
-
-
-
-
-
- sync: true,
-
-
-
- label: "",
-
-
- toggle: false,
-
-
- _duration: 800,
-
- inheritParams: function(){
- var parent = this.getParent();
- if(parent){
- if(!this.transition){ this.transition = parent.transition; }
- if(this.icon && parent.iconBase &&
- parent.iconBase.charAt(parent.iconBase.length - 1) === '/'){
- this.icon = parent.iconBase + this.icon;
- }
- if(!this.icon){ this.icon = parent.iconBase; }
- if(!this.iconPos){ this.iconPos = parent.iconPos; }
- }
- },
-
- select: function(){
-
-
-
-
- },
-
- deselect: function(){
-
-
-
-
- },
-
- defaultClickAction: function(e){
- if(this.toggle){
- if(this.selected){
- this.deselect();
- }else{
- this.select();
- }
- }else if(!this.selected){
- this.select();
- if(!this.selectOne){
- var _this = this;
- setTimeout(function(){
- _this.deselect();
- }, this._duration);
- }
- var transOpts;
- if(this.moveTo || this.href || this.url || this.scene){
- transOpts = {moveTo: this.moveTo, href: this.href, url: this.url, scene: this.scene, transition: this.transition, transitionDir: this.transitionDir};
- }else if(this.transitionOptions){
- transOpts = this.transitionOptions;
- }
- if(transOpts){
- return new TransitionEvent(this.domNode,transOpts,e).dispatch();
- }
- }
- },
-
- getParent: function(){
-
-
-
-
-
-
- var ref = this.srcNodeRef || this.domNode;
- return ref && ref.parentNode ? registry.getEnclosingWidget(ref.parentNode) : null;
- },
- setTransitionPos: function(e){
-
-
-
-
-
- var w = this;
- while(true){
- w = w.getParent();
- if(!w || w instanceof View){ break; }
- }
- if(w){
- w.clickedPosX = e.clientX;
- w.clickedPosY = e.clientY;
- }
- },
- transitionTo: function(moveTo, href, url, scene){
-
-
-
-
-
-
- if(config.isDebug){
- var alreadyCalledHash = arguments.callee._ach || (arguments.callee._ach = {}),
- caller = (arguments.callee.caller || "unknown caller").toString();
- if(!alreadyCalledHash[caller]){
- kernel.deprecated(this.declaredClass + "::transitionTo() is deprecated." +
- caller, "", "2.0");
- alreadyCalledHash[caller] = true;
- }
- }
- new TransitionEvent(this.domNode, {moveTo: moveTo, href: href, url: url, scene: scene,
- transition: this.transition, transitionDir: this.transitionDir}).dispatch();
- }
- });
- });
|