1 namespace('kivi.io', function(ns) {
4 ns.price_chooser_dialog = function(title, html) {
5 var id = 'jqueryui_popup_dialog';
11 close: function(event, ui) { $dialog.remove(); },
16 $dialog = $('<div style="display:none" id="' + id + '"></div>').appendTo('body');
17 $dialog.attr('title', title);
19 $dialog.dialog(dialog_params);
21 $('.cancel').click(ns.close_dialog);
26 ns.close_dialog = function() {
27 $dialog.dialog("close");
30 ns.price_chooser = function(i) {
31 var form = $('form').serializeArray();
32 form.push( { name: 'action', value: 'PriceSource/price_popup' }
33 , { name: 'row', value: i }
36 $.post('controller.pl', form, function(data) {
37 kivi.eval_json_result(data);
41 ns.update_price_source = function(row, source, price_str) {
42 $('#active_price_source_' + row).val(source);
43 if (price_str) $('#sellprice_' + row).val(price_str);
44 $('#update_button').click();
47 ns.update_discount_source = function(row, source, discount_str) {
48 $('#active_discount_source_' + row).val(source);
49 if (discount_str) $('#discount_' + row).val(discount_str);
50 $('#update_button').click();