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