View | Details | Raw Unified | Return to bug 27113
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/js/elasticsearch/autocomplete.js (-2 / +15 lines)
Lines 213-218 function autocomplete(inp, nb, left, right) { Link Here
213
        /* press Esc clear all autocomplete */
213
        /* press Esc clear all autocomplete */
214
        else if (e.keyCode == 8) {
214
        else if (e.keyCode == 8) {
215
            closeAllLists();
215
            closeAllLists();
216
        }
217
        /* press Tab clear all autocomplete */
218
        else if (e.keyCode == 9) {
219
            closeAllLists();
216
        };
220
        };
217
    });
221
    });
218
    function addActive(x) {
222
    function addActive(x) {
Lines 255-262 function autocomplete(inp, nb, left, right) { Link Here
255
            /* normalyzer hightlight without tags */
259
            /* normalyzer hightlight without tags */
256
            //inp.value = (inp.value.replace(/<\/?[^>]+(>|$)/g, "")).trim();
260
            //inp.value = (inp.value.replace(/<\/?[^>]+(>|$)/g, "")).trim();
257
            inp.value = this.innerText;
261
            inp.value = this.innerText;
258
            /* Submit form click mouse in div */
262
            
259
            this.closest("form").submit();
263
            var autocommit = 1;
264
            const inputs = document.querySelectorAll("#advanced-search input[type='text']");
265
            for (var i = 0; i < inputs.length && autocommit; i++) {
266
                var input = inputs[i];
267
                if (input === inp) {
268
                    autocommit = 0;
269
                }
270
            }
271
            //Submit form click mouse in div if not in advanced search
272
            if (autocommit) this.closest("form").submit();
260
        });
273
        });
261
        return b;
274
        return b;
262
    };
275
    };
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/opac-elasticsearch/opac-autocomplete.js (-3 / +15 lines)
Lines 209-214 function autocomplete(inp, nb, left, right) { Link Here
209
        /* press Esc clear all autocomplete */
209
        /* press Esc clear all autocomplete */
210
        else if (e.keyCode == 8) {
210
        else if (e.keyCode == 8) {
211
            closeAllLists();
211
            closeAllLists();
212
        }
213
        /* press Tab clear all autocomplete */
214
        else if (e.keyCode == 9) {
215
            closeAllLists();
212
        };
216
        };
213
    });
217
    });
214
    function addActive(x) {
218
    function addActive(x) {
Lines 251-258 function autocomplete(inp, nb, left, right) { Link Here
251
            /* normalyzer hightlight without tags */
255
            /* normalyzer hightlight without tags */
252
            //inp.value = (inp.value.replace(/<\/?[^>]+(>|$)/g, "")).trim();
256
            //inp.value = (inp.value.replace(/<\/?[^>]+(>|$)/g, "")).trim();
253
            inp.value = this.innerText;
257
            inp.value = this.innerText;
254
            /* Submit form click mouse in div */
258
            
255
            this.closest("form").submit();
259
            var autocommit = 1;
260
            const inputs = document.querySelectorAll("#booleansearch input[type='text']");
261
            for (var i = 0; i < inputs.length && autocommit; i++) {
262
                var input = inputs[i];
263
                if (input === inp) {
264
                    autocommit = 0;
265
                }
266
            }
267
            //Submit form click mouse in div if not in advanced search
268
            if (autocommit) this.closest("form").submit();
256
        });
269
        });
257
        return b;
270
        return b;
258
    };
271
    };
259
- 

Return to bug 27113