Вход Регистрация
Файл: plugins/social_sharing/static/js/admin.js
Строк: 58
<?php
var socialSharingAdmin = function( $params )
{
    var 
self this;

    
this.responderUrl $params.ajaxResponderUrl;
    var 
$questionTable = $('#socialsharing_settings');
    
    var 
checkbox = $('.sharing_item input[type="checkbox"]');
    
    
checkbox.click(function(){
        $.
ajax( {
            
urlself.responderUrl,
            
type'POST',
            
data: {
                
command'save_settings',
                
key: $(this).attr("name"),
                
value: $(this).is(':checked') ? 0
            
},
            
dataType'json'
        
} );
    });

    
$questionTable.sortable(
    {
        
items'.sharing_item',
        
cursor'move',
        
placeholder'forum_placeholder',
        
snaptrue,
        
snapToleranse50,
        
forcePlaceholderSizetrue,
        
connectWith'#socialsharing_settings',

        
update: function(eventui)
        {
            var 
table ui.item.parents("#socialsharing_settings");
            
            var 
orderNew = {};

            
table.find('.sharing_item').each(function(ordero){
                
orderNew[$(o).attr('item')] = order;
            });

            var 
$items $questionTable.find(".sharing_item");
            
$items.removeClass('peep_alt1');
            
$items.removeClass('peep_alt2');

            
$questionTable.find('.sharing_item:odd').addClass('peep_alt2');
            
$questionTable.find('.sharing_item:even').addClass('peep_alt1');

            $.
ajax( {
                
urlself.responderUrl,
                
type'POST',
                
data: {
                    
command'sort_sharing_item',
                    
order:JSON.stringify(orderNew)
                },
                
dataType'json'
            
} );

        },

        
start: function(eventui)
        {
            $(
ui.placeholder).append('<td colspan="2"></td>');
        }
    });
}
?>
Онлайн: 1
Реклама