From bc8f09a9bb989ffeb6c5ac2256ddf5ae24204139 Mon Sep 17 00:00:00 2001 From: nagoon97 Date: Thu, 18 Oct 2012 05:12:43 +0000 Subject: [PATCH] x_tabbable now triggers a 'tab_change' event when a tab is clicked git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11768 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/admin/tpl/js/admin.js | 3 +++ modules/menu/tpl/sitemap.html | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 8536b70e1..f504f2324 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -52,6 +52,9 @@ jQuery(function($){ var $this = $(this); $this.parent('li').addClass('x_active').siblings().removeClass('x_active'); $this.closest('.x_nav-tabs').next('.x_tab-content').find('>.x_tab-pane').eq($this.attr('data-index')-1).addClass('x_active').show().siblings().removeClass('x_active').hide(); + + $(this).parents('.x_tabbable').trigger('tab_change', [parseInt($(this).attr('data-index'))-1, $(this)]); + return false; }); // GNB diff --git a/modules/menu/tpl/sitemap.html b/modules/menu/tpl/sitemap.html index d04be4bdc..990870574 100644 --- a/modules/menu/tpl/sitemap.html +++ b/modules/menu/tpl/sitemap.html @@ -1862,6 +1862,10 @@ jQuery(function($){ $previewForm.find('input[name=act]').remove(); $previewForm.find('input[name=mid]').remove(); $previewForm.find('input[name=vid]').remove(); + /* + $('#design .x_tabbable').on('tab_change', function(ev, nIdx, $el){ + console.log(44, ev, nIdx, $el); + });*/ $('#design').bind('show', function(){ var sMenuId = $._xeAdminVar.sSelectedMenuSrl; var htInfo = htNodeInfo[sMenuId]; @@ -2088,6 +2092,8 @@ jQuery(function($){ $(this).closest('li').find('input[name=layout_item]').click(); }); $('#layout').on('click', 'input[name=layout_item]', function(){ + $('#layout').nextAll().hide(); + $('#layout').find('li.selected').removeClass('selected'); $(this).closest('li').addClass('selected');