Revision da09f329
Von Sven Schöling vor fast 8 Jahren hinzugefügt
js/kivi.Part.js | ||
---|---|---|
516 | 516 |
ns.PickerPopup = function(pp) { |
517 | 517 |
this.timer = undefined; |
518 | 518 |
this.pp = pp; |
519 |
this.open_dialog(); |
|
520 |
}; |
|
519 | 521 |
|
520 |
this.open_dialog = function() { |
|
522 |
ns.PickerPopup.prototype = { |
|
523 |
open_dialog: function() { |
|
521 | 524 |
var self = this; |
522 | 525 |
kivi.popup_dialog({ |
523 | 526 |
url: 'controller.pl?action=Part/part_picker_search', |
... | ... | |
534 | 537 |
}); |
535 | 538 |
window.clearTimeout(this.timer); |
536 | 539 |
return true; |
537 |
}; |
|
538 |
|
|
539 |
this.init_search = function() { |
|
540 |
}, |
|
541 |
init_search: function() { |
|
540 | 542 |
var self = this; |
541 | 543 |
$('#part_picker_filter').keypress(function(e) { self.result_timer(e) }).focus(); |
542 | 544 |
$('#no_paginate').change(function() { self.update_results() }); |
543 | 545 |
this.update_results(); |
544 |
} |
|
545 |
|
|
546 |
this.update_results = function() { |
|
546 |
}, |
|
547 |
update_results: function() { |
|
547 | 548 |
var self = this; |
548 | 549 |
$.ajax({ |
549 | 550 |
url: 'controller.pl?action=Part/part_picker_result', |
... | ... | |
558 | 559 |
self.init_results(); |
559 | 560 |
} |
560 | 561 |
}); |
561 |
}; |
|
562 |
|
|
563 |
this.init_results = function() { |
|
562 |
}, |
|
563 |
init_results: function() { |
|
564 | 564 |
var self = this; |
565 | 565 |
$('div.part_picker_part').each(function(){ |
566 | 566 |
$(this).click(function(){ |
... | ... | |
583 | 583 |
self.pp.dummy.focus(); |
584 | 584 |
} |
585 | 585 |
}); |
586 |
} |
|
587 |
|
|
588 |
this.result_timer = function(event) { |
|
586 |
}, |
|
587 |
result_timer: function(event) { |
|
589 | 588 |
var self = this; |
590 | 589 |
if (!$('no_paginate').prop('checked')) { |
591 | 590 |
if (event.keyCode == KEY.PAGE_UP) { |
... | ... | |
599 | 598 |
} |
600 | 599 |
window.clearTimeout(this.timer); |
601 | 600 |
this.timer = window.setTimeout(function() { self.update_results() }, 100); |
602 |
}; |
|
603 |
|
|
604 |
this.close_popup = function() { |
|
601 |
}, |
|
602 |
close_popup: function() { |
|
605 | 603 |
$('#part_selection').dialog('close'); |
606 |
}; |
|
607 |
|
|
608 |
this.open_dialog(); |
|
609 |
} |
|
604 |
} |
|
605 |
}; |
|
610 | 606 |
|
611 | 607 |
ns.reinit_widgets = function() { |
612 | 608 |
kivi.run_once_for('input.part_autocomplete', 'part_picker', function(elt) { |
Auch abrufbar als: Unified diff
kivi.Part.js: PickerPopup auf prototype style umgestellt