File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ Fixed:
103103 if the given property is unset for an element of the list. Crash
104104 fixed. New feature NoneFirst added to method to make unset values
105105 sort at start or end of sorted list. (John Rouillard)
106+ - issue2550648 - keyword boolean search. Issue has multiple problems.
107+ Fix issue where saving the keyword boolean search would remove the
108+ link to open the editor.
106109
107110Features:
108111- issue2550522 - Add 'filter' command to command-line
Original file line number Diff line number Diff line change 11# This module is free software, you may redistribute it
22# and/or modify under the same terms as Python.
33
4- WINDOW_CONTENT = r'''\
4+ WINDOW_CONTENT = r'''
55<h3>Keyword Expression Editor:</h3>
66<hr/>
77<div id="content"></div>
220220 return out;
221221}
222222
223- function main_content() {
223+ function main_display() {
224+ var out = '';
225+ out += '<span id="display_%(prop)s">' + parse(current).infix() + '<\/span>';
226+ return out;
227+ }
228+
229+ function main_input() {
224230 var out = '';
225231 out += '<input type="hidden" name="%(prop)s" value="' + current + '"\/>';
226- out += parse(current).infix();
227232 return out;
228233}
229234
230235function modify_main() {
231- main = window.opener.document.getElementById("keywords_%(prop)s");
232- main.innerHTML = main_content();
236+ /* if display form of expression exists, overwrite */
237+ display = window.opener.document.getElementById('display_%(prop)s');
238+ if ( display ) {
239+ display.outerHTML = main_display();
240+ }
241+
242+ /* overwrite select if present, otherwise overwrite the hidden input */
243+ input = window.opener.document.querySelector('select[name="%(prop)s"]');
244+ if (! input) {
245+ input = window.opener.document.querySelector('input[name="%(prop)s"]');
246+ }
247+
248+ /* if display exists, only update hidden input. If display doesn't
249+ exist, inject both hidden input and display. */
250+ if ( display ) {
251+ content = main_input();
252+ } else {
253+ content = main_input() + main_display();
254+ }
255+ input.outerHTML = content;
233256}
234257
235258function set_content() {
You can’t perform that action at this time.
0 commit comments