define([ "dojo/_base/declare", "dojo/_base/lang", "dojo/dom-construct", "dojo/dom-style", "dojo/dom-class", "dojo/on", "dojo/topic", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/text!./templates/SplashPage.html" ], function (declare, lang, domConstruct, domStyle,domClass, on, topic, _WidgetBase, _TemplatedMixin, template) { return declare("app.widgets.SplashPage", [_WidgetBase, _TemplatedMixin], { templateString: template, config: null, postCreate: function () { this.inherited(arguments); this._processArguments(); this._attachEventHandlers(); }, _attachEventHandlers: function () { var self = this; this.own( on(this.closeButton, "click", lang.hitch(this,this.dismissSplash)) ); }, _processArguments:function(){ console.log(this.config); if (typeof this.config.title!=="undefined"){ this.titleText.innerHTML = this.config.title; } if (typeof this.config.content!=="undefined"){ this.contentText.innerHTML = this.config.content; } if (typeof this.config.mode !== "undefined"){ if (this.config.mode.toLowerCase() != "dismissable" && this.config.mode.toLowerCase() != "dismissible" && this.config.mode.toLowerCase() != "dismissble"){ domStyle.set(this.closeButton, { display:"none" }); } else { domStyle.set(this.closeButton, { display:"inline" }); } } }, dismissSplash:function(){ domClass.add(this.splashPage,"splashPageDismiss"); setTimeout(function(){ domStyle.set(this.splashPage,{ display:"none" }); },600); topic.publish("splashDone",{}); } }); });