Files
alfresco-community-repo/source/web/scripts/ajax/dojo/src/widget/Toggler.js
Gavin Cornwell 838e7d5381 New build scripts
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5282 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2007-03-04 19:05:34 +00:00

37 lines
866 B
JavaScript

/*
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.Toggler");
dojo.require("dojo.widget.*");
dojo.require("dojo.event.*");
dojo.widget.defineWidget(
"dojo.widget.Toggler",
dojo.widget.HtmlWidget,
{
// summary:
// clicking on this widget shows/hides another widget
// targetId: String
// Id of widget to show/hide when this widget is clicked
targetId: '',
fillInTemplate: function() {
dojo.event.connect(this.domNode, "onclick", this, "onClick");
},
onClick: function() {
var pane = dojo.widget.byId(this.targetId);
if(!pane){ return; }
pane.explodeSrc = this.domNode;
pane.toggleShowing();
}
});