26 |
26 |
var state = STATES.PICKED;
|
27 |
27 |
var last_real = $real.val();
|
28 |
28 |
var last_dummy = $dummy.val();
|
29 |
|
var open_dialog = function(){
|
|
29 |
var timer;
|
|
30 |
|
|
31 |
function open_dialog () {
|
30 |
32 |
open_jqm_window({
|
31 |
33 |
url: 'controller.pl?action=Part/part_picker_search',
|
32 |
34 |
data: $.extend({
|
... | ... | |
34 |
36 |
}, ajax_data($dummy.val())),
|
35 |
37 |
id: 'part_selection',
|
36 |
38 |
});
|
|
39 |
window.clearTimeout(timer);
|
37 |
40 |
return true;
|
38 |
|
};
|
|
41 |
}
|
39 |
42 |
|
40 |
43 |
function ajax_data(term) {
|
41 |
44 |
var data = {
|
... | ... | |
89 |
92 |
});
|
90 |
93 |
};
|
91 |
94 |
|
|
95 |
function result_timer (event) {
|
|
96 |
window.clearTimeout(timer);
|
|
97 |
timer = window.setTimeout(update_results, 100);
|
|
98 |
}
|
|
99 |
|
92 |
100 |
function close_popup() {
|
93 |
101 |
$('#part_selection').jqmClose()
|
94 |
102 |
};
|
... | ... | |
156 |
164 |
}
|
157 |
165 |
});
|
158 |
166 |
|
159 |
|
// $dummy.blur(make_defined_state); // blur triggers also on open_jqm_dialog
|
|
167 |
$dummy.blur(function(){
|
|
168 |
window.clearTimeout(timer);
|
|
169 |
timer = window.setTimeout(make_defined_state, 100);
|
|
170 |
});
|
160 |
171 |
|
161 |
172 |
// now add a picker div after the original input
|
162 |
173 |
var pcont = $('<span>').addClass('position-absolute');
|
... | ... | |
173 |
184 |
convertible_unit: function() { return $convertible_unit },
|
174 |
185 |
column: function() { return $column },
|
175 |
186 |
update_results: update_results,
|
|
187 |
result_timer: result_timer,
|
176 |
188 |
set_item: set_item,
|
177 |
189 |
reset: make_defined_state,
|
178 |
190 |
init_results: function () {
|
make_defined_state auch beim Klicken ausserhalb des Pickers
Problem war, dass ein einfacher blur handler auch getriggert hat wenn das jqm
aufgeht. Dafür ist der timermechanismus jetzt mit ins widget gewandert und der
blur handler wird einfach abgebrochen