X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e92b111df5e022e68517682cf48ab5f73adc9e79..50b2bd9fca6a897828f89588e4d6a3ed912bb5a8:/js/common.js diff --git a/js/common.js b/js/common.js index 71f1d3104..904448d35 100644 --- a/js/common.js +++ b/js/common.js @@ -187,7 +187,23 @@ function open_jqm_window(params) { $(document).ready(function () { // initialize all jQuery UI tab elements: - $(".tabwidget").each(function(idx, element) { $(element).tabs(); }); + $(".tabwidget").each(function(idx, element) { + var $element = $(element); + var tabsParams = {}; + + var elementId = $element.attr('id'); + if( elementId ) { + var cookieName = 'jquery_ui_tab_'+ elementId; + + tabsParams.active = $.cookie(cookieName); + tabsParams.activate = function(event, ui) { + var i = ui.newTab.parent().children().index(ui.newTab); + $.cookie(cookieName, i); + }; + } + + $element.tabs(tabsParams); + }); $('input').focus(function(){ if (focussable(this)) window.focused_element = this;