##// END OF EJS Templates
clean up CSS and firefox clicks...
Mathieu -
Show More
@@ -123,7 +123,15 b' define(['
123 123
124 124 // Bind events for selection checkboxes.
125 125 $('.tree-selector').change(function(){that.select($(this).attr('id'),$(this).is(':checked'))});
126
126 $('#button-select-all').click(function(e) {
127 // toggle checkbox if the click doesn't come from the checkbox already
128 if (!$(e.target).is('input[type=checkbox]')) {
129 var checkbox = $('#select-all');
130 checkbox.prop('checked', !checkbox.prop('checked'));
131 that.select('select-all',checkbox.prop('checked'));
132 }
133 });
134
127 135 // Make the dropdown sticky
128 136 // Dirty solution by stopping click propagation
129 137 // $('#tree-selector-menu').click(function(event){event.stopPropagation();})
@@ -132,7 +140,8 b' define(['
132 140 $(this).parent().toggleClass('open');
133 141 });
134 142 $('body').on('click', function (e) {
135 if (!$('#tree-selector-btn').is(e.target) && $('#tree-selector-btn').has(e.target).length === 0 && $('.open').has(e.target).length === 0) {
143 // Close the menu if a click happens outside of the menu list (and of the tree-selector-btn)
144 if (!$('#tree-selector-btn').is(e.target) && $('#tree-selector-btn').has(e.target).length === 0 && $('#tree-selector-menu').has(e.target).length === 0) {
136 145 $('#tree-selector-btn').parent().removeClass('open');
137 146 }
138 147 });
@@ -520,8 +529,13 b' define(['
520 529 $('#'+checkbox_ids[i]).parent().parent().removeClass('disabled');
521 530 }
522 531 }
523 // Update badge
524 $('#badge-'+checkbox_ids[i]).text(selected_nums[i]===0 ? '' : selected_nums[i]);
532 // Update counters
533 // Turn empty counter into a ' ' on the main checkbox for correct button height.
534 var empty_counter = i===0 ? ' ' : '';
535 $('#counter-'+checkbox_ids[i]).html(selected_nums[i]===0 ? empty_counter : selected_nums[i]);
536 // Alternative : display selected/total
537 // $('#counter-'+checkbox_ids[i]).html(selected_nums[i]===0 ? empty_counter : selected_nums[i] + '/' + total_nums[i]);
538
525 539 // Update each checkbox status
526 540 if (selected_nums[i] === 0) {
527 541 $('#'+checkbox_ids[i])[0].indeterminate = false;
@@ -12,7 +12,6 b''
12 12 @btn_small_height: 24px;
13 13 @btn_mini_height: 22px;
14 14 @dark_dashboard_color: @breadcrumb-color;
15 @list_stripe_color: lighten(@page-backdrop-color,3%);
16 15
17 16 // The left padding of the selector button's contents.
18 17 @dashboard-selectorbtn-lpad: 7px;
@@ -183,25 +182,23 b' input.engine_num_input {'
183 182 }
184 183
185 184 #tree-selector {
186 display: inline-block;
187 padding-right: 5px;
185 padding-right: 0px;
186 }
187
188 #button-select-all {
189 min-width: 50px;
188 190 }
189 191
190 192 #select-all {
191 margin-top:-1px;
192 193 margin-left: @dashboard_lr_pad;
193 vertical-align: baseline;
194 margin-right: 2px;
194 195 }
195 196
196 197 #tree-selector-menu {
197 width: 200px;
198 .menuitem label{
199 margin-bottom: 0px;
200 }
201 input[type=checkbox] {
202 margin-left: 0px;
203 vertical-align: baseline;
204 }
198 width: 200px;
199 input[type=checkbox] {
200 margin-left: 0px;
201 }
205 202 }
206 203
207 204 .tab-content .row {
@@ -77,9 +77,8 b' data-terminals-available="{{terminals_available}}"'
77 77 <div id="notebook_list">
78 78 <div id="notebook_list_header" class="row list_header">
79 79 <div class="btn-group dropdown" id='tree-selector'>
80 <button type="button" class="btn btn-default btn-xs">
81 <span class="badge pull-right" id="badge-select-all"></span>
82 <input type="checkbox" class="tree-selector" id="select-all"></input>
80 <button type="button" class="btn btn-default btn-xs" id="button-select-all">
81 <input type="checkbox" class="tree-selector pull-left" id="select-all"><span id="counter-select-all">&nbsp;</span></input>
83 82 </button>
84 83 <button class="btn btn-default btn-xs dropdown-toggle" type="button" id="tree-selector-btn" aria-expanded="true">
85 84 <span class="caret"></span>
@@ -88,7 +87,7 b' data-terminals-available="{{terminals_available}}"'
88 87 <ul id="tree-selector-menu" class="dropdown-menu" role="menu" aria-labelledby="tree-selector-btn">
89 88 <li role="presentation">
90 89 <a role="menuitem">
91 <span class="badge pull-right" id="badge-select-folders"></span>
90 <span class="badge pull-right" id="counter-select-folders"></span>
92 91 <input type="checkbox" class="tree-selector" id="select-folders"></input>
93 92 <label for="select-folders">
94 93 <i class="folder_icon icon-fixed-width"></i>
@@ -98,7 +97,7 b' data-terminals-available="{{terminals_available}}"'
98 97 </li>
99 98 <li role="presentation">
100 99 <a role="menuitem">
101 <span class="badge pull-right" id="badge-select-notebooks"></span>
100 <span class="badge pull-right" id="counter-select-notebooks"></span>
102 101 <input type="checkbox" class="tree-selector" id="select-notebooks"></input>
103 102 <label for="select-notebooks">
104 103 <i class="notebook_icon icon-fixed-width"></i>
@@ -108,7 +107,7 b' data-terminals-available="{{terminals_available}}"'
108 107 </li>
109 108 <li role="presentation">
110 109 <a role="menuitem">
111 <span class="badge pull-right" id="badge-select-running-notebooks"></span>
110 <span class="badge pull-right" id="counter-select-running-notebooks"></span>
112 111 <input type="checkbox" class="tree-selector" id="select-running-notebooks"></input>
113 112 <label for="select-running-notebooks">
114 113 <i class="running_notebook_icon icon-fixed-width"></i>
@@ -118,7 +117,7 b' data-terminals-available="{{terminals_available}}"'
118 117 </li>
119 118 <li role="presentation">
120 119 <a role="menuitem">
121 <span class="badge pull-right" id="badge-select-files"></span>
120 <span class="badge pull-right" id="counter-select-files"></span>
122 121 <input type="checkbox" class="tree-selector" id="select-files"></input>
123 122 <label for="select-files">
124 123 <i class="file_icon icon-fixed-width"></i>
General Comments 0
You need to be logged in to leave comments. Login now