From 8bf95e9789e32433f748db12a27f2dd8990ae4e8 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Tue, 16 Jul 2013 14:30:12 +0200 Subject: [PATCH] =?utf8?q?Ausgeh=C3=A4hlten=20Tab=20nur=20dann=20speichern?= =?utf8?q?,=20wenn=20eine=20ID=20angegeben=20wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/common.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/js/common.js b/js/common.js index 182d47d9b..904448d35 100644 --- a/js/common.js +++ b/js/common.js @@ -188,15 +188,21 @@ function open_jqm_window(params) { $(document).ready(function () { // initialize all jQuery UI tab elements: $(".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 $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(){ -- 2.20.1