From d6d93439fa04dfff452e621b7334fc5f9ff8be59 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Tue, 2 Jul 2013 16:30:45 +0200 Subject: [PATCH] =?utf8?q?Ge=C3=B6ffnete=20Tabs=20in=20Cookies=20speichern?= =?utf8?q?=20+=20wiederaufrufen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/common.js | 12 +++++++++++- templates/webpages/customer_vendor/form.html | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/js/common.js b/js/common.js index 71f1d3104..182d47d9b 100644 --- a/js/common.js +++ b/js/common.js @@ -187,7 +187,17 @@ 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) { + element = $(element); + var cookieName = 'jquery_ui_tab_'+ element.attr('id'); + element.tabs({ + active: $.cookie(cookieName), + activate: function(event, ui) { + var i = ui.newTab.parent().children().index(ui.newTab); + $.cookie(cookieName, i); + }, + }); + }); $('input').focus(function(){ if (focussable(this)) window.focused_element = this; diff --git a/templates/webpages/customer_vendor/form.html b/templates/webpages/customer_vendor/form.html index caef36906..9aed70936 100644 --- a/templates/webpages/customer_vendor/form.html +++ b/templates/webpages/customer_vendor/form.html @@ -13,7 +13,7 @@ [%- INCLUDE 'common/flash.html' %] -
+