Revision 190e3256 ui/templates/list.html

b/ui/templates/list.html
25 25
            <tr> 
26 26
                <th id="selection" class="select-running">
27 27
                    <input type="checkbox"/>
28
                    <div class="expand-icon"></div>
29
                    <ul style="display: none">
30
                        <li class="select-all" ><a href="#">all</a></li>
31
                        <li class="select-none"><a href="#">none</a></li>
32
                        <li class="select-group"><a href="#">group</a></li>
33
                    </ul>            
28
                    <div class="expand-icon"></div>          
34 29
                </th>
35 30
                <th id="os">OS</th> 
36 31
                <th id="name">Name</th> 
......
41 36
        </thead> 
42 37
        <tbody class="machines"></tbody>
43 38
    </table>
39
	<ul class="dropdown-selector" style="display: none">
40
		<li class="select-all" ><a href="#">all</a></li>
41
		<li class="select-none"><a href="#">none</a></li>
42
		<li class="select-group"><a href="#">group</a></li>
43
	</ul>  
44 44
</div>
45 45

  
46 46
<script>
......
54 54
        $(":checkbox").attr("checked", false);
55 55
    }
56 56
	updateActions();
57
	return false;
57 58
});
58 59

  
59
// select all/none/group from drop down menu
60
$("table thead tr th#selection ul li").live('click', function() {
61
    // all or none?
62
    if ( $(this).attr("class") == "select-all" || $(this).attr("class") == "select-none") {
63
        var all = ($(this).attr("class") == "select-all");
64
        // toggle checkboxes
65
        $(":checkbox").attr("checked", all);
66
    } else if ($(this).attr("class") == "select-group"){
67
        // TODO: This shoud select only the vms in the selected group
68
        // right now the folowing has the functionality of select-all        
69
        $(":checkbox").attr("checked", true);
70
    }
71
    // update actions
72
	updateActions();
73
	return false;
60
// select all from drop down menu
61
$("ul.dropdown-selector li.select-all a").live('click', function() {
62
	$(":checkbox").attr("checked", true);
63
	return false;	
74 64
});
75 65

  
76
// menu toggle, running menu
77
$("table.list-machines thead tr th#selection div.expand-icon").live('click', function () {
78
	$("table.list-machines thead tr th#selection ul").slideToggle('medium');
79
    return false;
66
// select none from drop down menu
67
$("ul.dropdown-selector li.select-none a").live('click', function() {
68
	$(":checkbox").attr("checked", false);
69
	return false;	
80 70
});
81 71

  
82
$("table.list-machines thead tr th#selection ul").live('click', function () {
83
	$("table.list-machines thead tr th#selection ul").slideToggle('medium');
72
// select group from drop down menu
73
$("ul.dropdown-selector li.select-group a").live('click', function() {
74
	$(":checkbox").attr("checked", true);
75
	return false;
76
});
77

  
78
// menu toggle, running menu
79
$("table.list-machines thead tr th#selection .expand-icon").click( function (obj) {
80
	$(".dropdown-selector").slideToggle('medium');
84 81
    return false;
85 82
});
86 83

  

Also available in: Unified diff