Geƶffnete Tabs in Cookies speichern + wiederaufrufen
authorThomas Heck <theck@linet-services.de>
Tue, 2 Jul 2013 14:30:45 +0000 (16:30 +0200)
committerThomas Heck <theck@linet-services.de>
Tue, 16 Jul 2013 12:23:56 +0000 (14:23 +0200)
js/common.js
templates/webpages/customer_vendor/form.html

index 71f1d31..182d47d 100644 (file)
@@ -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;
index caef369..9aed709 100644 (file)
@@ -13,7 +13,7 @@
 
   [%- INCLUDE 'common/flash.html' %]
 
-  <div class="tabwidget">
+  <div class="tabwidget" id="customer_vendor_tabs">
     <ul>
       <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
       <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>