~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/yui/tests/button/tests/manual/basic.html

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
<html>
3
 
    <head>
4
 
        <!-- reset the default browser styles -->
5
 
        <style>
6
 
 
7
 
            /* Fix this - Shouldn't require body specificity */
8
 
            body .yui3-button-selected {
9
 
                background-color:#426FD9;
10
 
                color:white;
11
 
            }
12
 
          
13
 
        </style>
14
 
      
15
 
        <script src='../../../../build/yui/yui-min.js'></script>
16
 
 
17
 
        <script>
18
 
            YUI({
19
 
                base: '../../../../build/',
20
 
                debug: true,
21
 
                combo: false,
22
 
                filter: 'raw'
23
 
            }).use('button', 'console', function(Y){
24
 
                
25
 
                new Y.Console().render();
26
 
                
27
 
                var push = new Y.Button({
28
 
                    label: 'Click to select',
29
 
                    srcNode: Y.one('#push')
30
 
                }).render();
31
 
                push.on('click', function(e){
32
 
                    push.set('selected', true);
33
 
                    Y.log('click push')
34
 
                });
35
 
                push.once('selectedChange', function(){
36
 
                    push.set('label', 'Click to disable');
37
 
                    push.on('click', function(){
38
 
                        push.set('label', 'Disabled');
39
 
                        push.set('selected', false);
40
 
                        push.set('disabled', true);
41
 
                    })
42
 
                })
43
 
                
44
 
                var toggle = new Y.ToggleButton({
45
 
                    label: 'Click to toggle',
46
 
                    srcNode: '#toggle'
47
 
                }).render();
48
 
                
49
 
                var disabled = new Y.Button({
50
 
                    srcNode: '#disabled',
51
 
                    disabled: true
52
 
                }).render();
53
 
                
54
 
                toggle.on('click', function(e){
55
 
                    Y.log('click toggle')
56
 
                });
57
 
            });
58
 
        </script>
59
 
    </head>
60
 
    
61
 
    <body class='yui3-skin-sam'>
62
 
        
63
 
        <div id='yconsole'></div>
64
 
        
65
 
        <h1>Button Example: Basic</h1>
66
 
        
67
 
        <hr />
68
 
 
69
 
        <h2>Push w/ event</h2>
70
 
        <button id='push' tabindex='3'>Button</button>
71
 
        
72
 
        
73
 
        <br>
74
 
        
75
 
        
76
 
        <h2>Toggle</h2>
77
 
        <input type='button' id='toggle' value='Toggle'></input>
78
 
        
79
 
        
80
 
        <br>
81
 
        
82
 
        
83
 
        <h2>disabled</h2>
84
 
        <input type='button' id='disabled' value='disabled'></input>
85
 
        
86
 
    </body>
87
 
</html>
 
 
b'\\ No newline at end of file'