Commit b71bf9deba9b8d4c462334fe8150cf161c35bbe4

Authored by janek37
1 parent 172cc5ba

przed wyszukiwaniem sprawdzamy czy tekst się zmienił

--HG--
branch : beta
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
1   -{% load staticfiles %}<!DOCTYPE HTML>
  1 +<!DOCTYPE HTML>
  2 +{% load staticfiles %}
2 3 <html>
3 4 <head>
4 5 <link href="{% static 'css/latolatinfonts.css' %}" rel="stylesheet" type="text/css">
... ...
dictionary/static/js/lexeme-view.js
... ... @@ -368,6 +368,7 @@ $.extend(slickgrid, {
368 368 slickgrid.search();
369 369 return;
370 370 }
  371 + slickgrid.last_search = slickgrid.search_string();
371 372 edit.highlight_form = slickgrid.search_string();
372 373 if (data.rows.length === 1) {
373 374 var row = data.rows[0].row;
... ...
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 }
... ...