define([ "dojo/_base/declare", "dojo/dom-construct", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dojo/text!./templates/Help.html" ], function (declare, domConstruct, _WidgetBase, _TemplatedMixin, template) { return declare("app.widgets.Help", [_WidgetBase, _TemplatedMixin], { templateString: template, config: null, postCreate: function () { this.inherited(arguments); this._attachEventHandlers(); this.initHelpLinks(this.config); }, _attachEventHandlers: function () { var self = this; this.own( ); }, initHelpLinks: function(config) { if(!config||!config.helpLinks) return; for(var i = 0; i < config.helpLinks.length; i++) { this._createLink(config.helpLinks[i]); } }, _createLink: function(link) { if(!link) return; var ICONCLASSMAPPING = { link: "fa fa-external-link", email: "fa fa-envelope-o" }; var li = domConstruct.create("li"); var a = domConstruct.create("a", { href: link.url || "#", title: link.title || "", target: "_blank" }, li); var aText = document.createTextNode(a.title); a.appendChild(aText); var iconSpan = domConstruct.create("span", { "class": "icon " + ICONCLASSMAPPING[link.type] || "" }, a); this.LinksNode.appendChild(li); } }); });