X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a4d38233df45f80fb98c503108b40294d212653a..2524843b93c48a8f24c5dadc4b3dd07e65e4770b:/js/common.js diff --git a/js/common.js b/js/common.js index d2594a277..71f1d3104 100644 --- a/js/common.js +++ b/js/common.js @@ -162,25 +162,26 @@ function focus_by_name(name){ function open_jqm_window(params) { params = params || { }; - var url = params.url; - var id = params.id ? params.id : 'jqm_popup_dialog'; - - if (params.data) { - var data = typeof params.data === "string" ? params.data : $.param(params.data); - url += (/\?/.exec(url) ? "&" : "?") + data; - } + var id = params.id ? params.id : 'jqm_popup_dialog'; $('#' + id).remove(); var div = $('
').hide().appendTo('body'); var close = $('').appendTo(div); var content = $('').appendTo(div); + div.jqm({ modal: true }); div.jqmShow(); - $.ajax({ url: url, success: function(new_html) { $(content).html(new_html); } }); $(close).click(function() { div.jqmClose(); }); + $.ajax({ + url: params.url, + data: params.data, + type: params.type, + success: function(new_html) { $(content).html(new_html); } + }); + return true; } @@ -191,6 +192,11 @@ $(document).ready(function () { $('input').focus(function(){ if (focussable(this)) window.focused_element = this; }); + + var initial_focus = $(".initial_focus").filter(':visible')[0]; + if (initial_focus) + $(initial_focus).focus(); + // legacy. sone forms install these if (typeof fokus == 'function') { fokus(); return; } if (focus_by_name('cursor_fokus')) return;