X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/5f68c97560deb16f78ab3331e13e692981bc2c1e..ff6cd9b714ffff6797df2c68e4dfeebcd1b86d08:/js/common.js diff --git a/js/common.js b/js/common.js index e40b9abfe..71f1d3104 100644 --- a/js/common.js +++ b/js/common.js @@ -160,6 +160,31 @@ function focus_by_name(name){ return false; } +function open_jqm_window(params) { + params = params || { }; + 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(); + $(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; +} + $(document).ready(function () { // initialize all jQuery UI tab elements: $(".tabwidget").each(function(idx, element) { $(element).tabs(); }); @@ -167,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;