|
155 | 155 | num_by_attr = [];
|
156 | 156 | child_count_by_attr = [];
|
157 | 157 | for (var i = 0; i < non_id_attributes.length; i++) {
|
158 |
| - if (non_id_attributes[i] == 'class' && el.hasAttribute('class')) { |
159 |
| - class_name = el.getAttribute('class'); |
160 |
| - if (class_name.length > 0 && !class_name.includes(' ') && |
161 |
| - class_name.includes('-')) |
162 |
| - { |
163 |
| - selector_by_class = tag_name + '.' + class_name; |
164 |
| - all_by_class = document.querySelectorAll(selector_by_class); |
165 |
| - if (all_by_class.length == 1) |
166 |
| - return selector_by_class; |
167 |
| - } |
168 |
| - continue; |
| 158 | + selector_by_attr[i] = null; |
| 159 | + if (non_id_attributes[i] == 'class') |
| 160 | + selector_by_attr[i] = selector_by_class; |
| 161 | + else { |
| 162 | + selector_by_attr[i] = cssPathByAttribute(el, non_id_attributes[i]); |
169 | 163 | }
|
170 |
| - selector_by_attr[i] = cssPathByAttribute(el, non_id_attributes[i]); |
171 | 164 | all_by_attr[i] = document.querySelectorAll(selector_by_attr[i]);
|
172 | 165 | num_by_attr[i] = all_by_attr[i].length;
|
173 | 166 | if (!selector_by_attr[i].includes(child_sep) &&
|
|
646 | 639 | if (ra_len > 0 && event.key.toLowerCase() === 'enter' &&
|
647 | 640 | document.recorded_actions[ra_len-1][0] === 'input' &&
|
648 | 641 | document.recorded_actions[ra_len-1][1] === selector &&
|
649 |
| - !document.recorded_actions[ra_len-1][2].endsWith('\n') && |
650 |
| - document.recorded_actions[ra_len-1][2].length > 0 && |
651 |
| - element.value.length == 0) |
| 642 | + !document.recorded_actions[ra_len-1][2].endsWith('\n')) |
652 | 643 | {
|
653 | 644 | s_text = document.recorded_actions[ra_len-1][2] + '\n';
|
654 | 645 | document.recorded_actions.pop();
|
|
0 commit comments