Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[ljcom] r9823: LJSUP-7377: Wishlist.

Committer: pkornilov
LJSUP-7377: Wishlist.
U   trunk/htdocs/js/pay.js
Modified: trunk/htdocs/js/pay.js
===================================================================
--- trunk/htdocs/js/pay.js	2010-12-10 10:17:55 UTC (rev 9822)
+++ trunk/htdocs/js/pay.js	2010-12-10 12:15:17 UTC (rev 9823)
@@ -146,16 +146,9 @@
 		// and recalc after refresh
 		.filter(':checked').change();
 		
-		this.tabsChanger({
-			links: '#paidaccount_features .m-paidfeatures a',
-			containers: '#paidaccount_features .b-paidfeatures-items>li'
-		});
+		jQuery('#paidaccount_features .m-paidfeatures').tabsChanger('#paidaccount_features .b-paidfeatures-items');
+		jQuery('#paidaccount_proceed .m-buy-types').tabsChanger();
 		
-		this.tabsChanger({
-			links: '#paidaccount_proceed .m-buy-types a',
-			containers: '#paidaccount_proceed .b-buy-goods>li'
-		});
-		
 		AutoCompleteFriends($('forother'));
 	},
 	
@@ -195,10 +188,7 @@
 		// and recalc after refresh
 		.filter(':checked').change();
 		
-		this.tabsChanger({
-			links: '#shop_wallet .m-shop-tabs a',
-			containers: '#shop_wallet .b-wallet-tokens>li'
-		});
+		jQuery('#shop_wallet .m-shop-tabs').tabsChanger();
 		
 		AutoCompleteFriends($('send_to'));
 		
@@ -271,10 +261,7 @@
 	
 	pageUserheads: function()
 	{
-		this.tabsChanger({
-			links: '#shop_userheads .m-buy-types-item a',
-			containers: '#shop_userheads .b-buy-goods>li'
-		});
+		jQuery('#shop_userheads .m-buy-types').tabsChanger();
 		
 		jQuery('.b-userheads-item input:radio')
 			.change(function(){
@@ -329,10 +316,7 @@
 	
 	pageUserpics: function()
 	{
-		this.tabsChanger({
-			links: '#shop_userpics .m-buy-types a',
-			containers: '#shop_userpics .b-buy-goods>li'
-		});
+		jQuery('#shop_userpics .m-buy-types').tabsChanger();
 		
 		if ($('giftto')) {
 			jQuery('#buy_gift').click(function(){
@@ -419,33 +403,6 @@
 	{
 		// mobile webkit, support :hover
 		jQuery('#shop_vgift .b-gifts-catalog>ul>li>div').click(jQuery.noop);
-	},
-	
-	/* function based on markup:
-		tab links: ul>li>a
-		current tab: ul>li.current
-		tab container: ul>li
-		tab container current: ul>li.current
-	*/
-	tabsChanger: function(conf)
-	{
-		var links = jQuery(conf.links)
-		links.click(function(e)
-		{
-			var item = jQuery(this).parent(),
-				index = item.index(),
-				containers = jQuery(conf.containers)
-			if (containers[index]) {
-				links.parent().removeClass('current');
-				item.addClass('current');
-				
-				containers.removeClass('current')
-					.eq(index)
-					.addClass('current');
-				
-				e.preventDefault();
-			}
-		});
 	}
 }
 

Tags: js, ljcom, lusever
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments