All pastes #606726 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-07 01:35 UTC
rendered paste body
dojo.lang.declare('app.menu.Menu', null, {

	initializer : function () {
		this.actions = new app.menu.Actions();
		this.showHTML();
	},
	
	htmlData : document.createElement("div") ,
	htmlDataLoad : false , 
	actions : undefined , 
	
	formObjectInit : function(loadedObj){
		try{
			var divs = loadedObj.getElementsByTagName("DIV");
			for(var i=0; i < divs.length ; i++ ){
				dojo.widget.createWidget(divs[i]);
			}
		}catch(e){
			ortho.exception( e , this , " error in function formObjectInit "); 
		}
	},
		
	
	showHTML : function () { 
		if ( this.htmlDataLoad ) { 
			// show html 
		} else { 
			this.getHTML();
		}
	} , 
	
	getHTML : function () {
		var self = this;
		dojo.io.bind({
		    url: "js/app/menu/menu.html",
		    load: function(type, data, evt){ self.processHTML( type , data , evt ); },
		    mimetype: "text/html"
		});
	} , 
	
	processHTML : function (type, data, evt) { 
		try { 
			dojo.require("dojo.widget.Menu2");
			dojo.hostenv.writeIncludes();
			this.htmlData.innerHTML = data;
			document.getElementById("menu").appendChild(this.htmlData);
			this.formObjectInit(document.getElementById("menu"));
		} catch ( e ) { ortho.exception( e , this , " error in function processHTML "); }
	}
	
});