Commit b71bf9deba9b8d4c462334fe8150cf161c35bbe4
1 parent
172cc5ba
przed wyszukiwaniem sprawdzamy czy tekst się zmienił
--HG-- branch : beta
Showing
4 changed files
with
10 additions
and
3 deletions
common/static/js/slickgrid.js
... | ... | @@ -7,6 +7,7 @@ var slickgrid = { |
7 | 7 | set_active_when_loaded: undefined, |
8 | 8 | skip_cell_changed: false, |
9 | 9 | last_active_row: undefined, |
10 | + last_search: undefined, | |
10 | 11 | |
11 | 12 | op_names: { |
12 | 13 | eq: gettext("równy|równa|równe"), |
... | ... | @@ -65,8 +66,11 @@ var slickgrid = { |
65 | 66 | |
66 | 67 | scroll_search: function() { |
67 | 68 | "use strict"; |
69 | + if (slickgrid.search_string() === slickgrid.last_search) | |
70 | + return; | |
71 | + slickgrid.last_search = slickgrid.search_string(); | |
68 | 72 | slickgrid.search_counter++; |
69 | - slickgrid.loader.onDataLoading.notify(); | |
73 | + //slickgrid.loader.onDataLoading.notify(); | |
70 | 74 | slickgrid.loader.searchRow( |
71 | 75 | slickgrid.search_counter, slickgrid.search_string(), |
72 | 76 | function (row) { |
... | ... | @@ -335,6 +339,7 @@ function apply_filter(filter, reload) { |
335 | 339 | $(function() { |
336 | 340 | "use strict"; |
337 | 341 | var columns = $dj.columns || slickgrid.initial_columns; |
342 | + slickgrid.last_search = slickgrid.search_string(); | |
338 | 343 | slickgrid.element = $('#' + slickgrid.grid_element_id); |
339 | 344 | slickgrid.grid = new Slick.Grid( |
340 | 345 | slickgrid.element, slickgrid.loader.data, columns_from_ids(columns), |
... | ... |
common/templates/base.html
dictionary/static/js/lexeme-view.js
dictionary/static/js/remotemodel.js
... | ... | @@ -175,7 +175,7 @@ |
175 | 175 | method: 'get', |
176 | 176 | data: data, |
177 | 177 | callback: function(data) { |
178 | - if ($('#text-search').val() === search_text && | |
178 | + if (slickgrid.search_string() === search_text && | |
179 | 179 | slickgrid.search_counter === search_counter) |
180 | 180 | callback(data.index); |
181 | 181 | } |
... | ... |