1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
<title>LAZR JS Examples: Combo Loader</title>
6
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
8
<script type="text/javascript" src="../build/yui/yui.js"></script>
9
<script type="text/javascript" src="../build/lazr/lazr-meta.js"></script>
10
<script type="text/javascript">
11
var LAZR_YUI_CONFIG = {
13
comboBase: "http://localhost:9876/combo?",
16
modules: LAZR_MODULES,
22
<body class="yui-skin-sam">
23
<h1>The lazr.overlay module</h1>
25
<h2>Drawing a fancy border around widgets</h2>
28
<code>lazr</code> provides an overlay implementation which draws a rounded-corner,
29
drop-shadow frame around the widget content. Closing the overlay is done by
30
either using the close button, pressing Escape, or clicking outside the overlay.
31
The click outside the overlay (which dismisses it) will <em>not</em> be passed
32
through to the HTML underneath.</p>
34
<h2>Demonstration</h2>
35
<p>This link is <a href="javascript: alert('I was clicked')">not clickable
36
while the overlay is showing</a></p>
37
<p><a href="#" id="re-open">Re-open the overlay to test again</a></p>
39
<h2>Subclasses: things you must know</h2>
40
<p>Subclasses <em>must</em> call this class's <code>bindUI</code> if they override
41
it: use an incantation like <code>this.constructor.superclass.bindUI.call(this)</code>
42
in the subclass's <code>bindUI</code>.</p>
43
<p>Subclasses <em>must</em> implement the <code>-hidden</code> style for their
44
box themselves. If you subclass <code>PrettyOverlay</code> as
45
<code>MySuperOverlay</code> then you need to add</p>
47
.yui-mysuperoverlay-hidden {
51
<p>to your CSS. (<code>PrettyOverlay</code> itself can't do this because although
52
YUI adds <code>.yui-prettyoverlay</code> to the className of the
53
<code>boundingBox</code>, it does <em>not</em> add
54
<code>.yui-prettyoverlay-hidden</code> when hiding the widget.)</p>
57
<h3>Subclassing (probably what you want)</h3>
59
YUI().use('lazr.overlay', function(Y) {
61
var MyThing = function() {
62
MyThing.superclass.constructor.apply(this, arguments);
64
Y.extend(MyThing, Y.lazr.PrettyOverlay, {
66
// call PrettyOverlay's bindUI
67
this.constructor.superclass.bindUI.call(this);
68
// and do my own binding
73
var thing = new MyThing({
75
headerContent: 'heading',
77
points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
86
<h3>Instantiating directly (probably not what you want)</h3>
88
YUI().use('lazr.overlay', function(Y) {
89
var overlay = new Y.lazr.PrettyOverlay({
91
headerContent: 'heading',
93
points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
103
<p>You can only specify <code>progressbar: {true, false}</code> in the initial
104
config object; it cannot be altered once <code>renderUI()</code> has been called.</p>
105
<p>Your progress bar will only appear if you have <code>headerContent</code>.</p>
108
<script type="text/javascript">
109
YUI(LAZR_YUI_CONFIG).use('loader', 'cssbase', 'cssfonts', 'cssreset', 'lazr.overlay', function(Y) {
110
var overlay = new Y.lazr.PrettyOverlay({
111
bodyContent: 'hello',
112
headerContent: '<h2>heading</h2>',
113
steptitle: 'First step',
115
points: [Y.WidgetPositionExt.CC, Y.WidgetPositionExt.CC]
122
Y.on('click', function(e) {