TaskBar.js
资源名称:oa.rar [点击查看]
上传用户:kimgenplus
上传日期:2016-06-05
资源大小:20877k
文件大小:2k
源码类别:
OA系统
开发平台:
Java
- /*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
- http://dojotoolkit.org/community/licensing.shtml
- */
- dojo.provide("dojo.widget.TaskBar");
- dojo.require("dojo.widget.*");
- dojo.require("dojo.widget.FloatingPane");
- dojo.require("dojo.widget.HtmlWidget");
- dojo.require("dojo.event.*");
- dojo.require("dojo.html.selection");
- dojo.widget.defineWidget("dojo.widget.TaskBarItem", dojo.widget.HtmlWidget, {iconSrc:"", caption:"Untitled", templateString:"<div class="dojoTaskBarItem" dojoAttachEvent="onClick">n</div>n", templateCssString:".dojoTaskBarItem {ntdisplay: inline-block;ntbackground-color: ThreeDFace;ntborder: outset 2px;ntmargin-right: 5px;ntcursor: pointer;ntheight: 35px;ntwidth: 100px;ntfont-size: 10pt;ntwhite-space: nowrap;nttext-align: center;ntfloat: left;ntoverflow: hidden;n}nn.dojoTaskBarItem img {ntvertical-align: middle;ntmargin-right: 5px;ntmargin-left: 5px;tntheight: 32px;ntwidth: 32px;n}nn.dojoTaskBarItem a {nt color: black;nttext-decoration: none;n}nnn", templateCssPath:dojo.uri.moduleUri("dojo.widget", "templates/TaskBar.css"), fillInTemplate:function () {
- if (this.iconSrc) {
- var img = document.createElement("img");
- img.src = this.iconSrc;
- this.domNode.appendChild(img);
- }
- this.domNode.appendChild(document.createTextNode(this.caption));
- dojo.html.disableSelection(this.domNode);
- }, postCreate:function () {
- this.window = dojo.widget.getWidgetById(this.windowId);
- this.window.explodeSrc = this.domNode;
- dojo.event.connect(this.window, "destroy", this, "destroy");
- }, onClick:function () {
- this.window.toggleDisplay();
- }});
- dojo.widget.defineWidget("dojo.widget.TaskBar", dojo.widget.FloatingPane, function () {
- this._addChildStack = [];
- }, {resizable:false, titleBarDisplay:false, addChild:function (child) {
- if (!this.containerNode) {
- this._addChildStack.push(child);
- } else {
- if (this._addChildStack.length > 0) {
- var oarr = this._addChildStack;
- this._addChildStack = [];
- dojo.lang.forEach(oarr, this.addChild, this);
- }
- }
- var tbi = dojo.widget.createWidget("TaskBarItem", {windowId:child.widgetId, caption:child.title, iconSrc:child.iconSrc});
- dojo.widget.TaskBar.superclass.addChild.call(this, tbi);
- }});