mirror of
https://bitbucket.org/theswgsource/auth-site-1.2.git
synced 2026-01-17 00:04:55 -05:00
53 lines
878 B
JavaScript
53 lines
878 B
JavaScript
var ViewManager = {
|
|
init: function()
|
|
{
|
|
if(!$('#fields_enabled') || !$('#fields_disabled'))
|
|
{
|
|
return;
|
|
}
|
|
|
|
if(!$('#fields_js'))
|
|
{
|
|
return;
|
|
}
|
|
|
|
$("#fields_enabled").sortable({
|
|
connectWith: "#fields_disabled",
|
|
dropOnEmpty: true,
|
|
update: function(event, ui) {
|
|
ViewManager.buildFieldsList();
|
|
}
|
|
}).disableSelection();
|
|
|
|
$("#fields_disabled").sortable({
|
|
connectWith: "#fields_enabled",
|
|
dropOnEmpty: true,
|
|
update: function(event, ui) {
|
|
ViewManager.buildFieldsList();
|
|
}
|
|
}).disableSelection();
|
|
},
|
|
|
|
buildFieldsList: function()
|
|
{
|
|
new_input = '';
|
|
$('#fields_enabled').children().each(function() {
|
|
id = $(this).attr('id').split("-");
|
|
|
|
if(id[1])
|
|
{
|
|
if(new_input)
|
|
{
|
|
new_input += ",";
|
|
}
|
|
new_input += id[1];
|
|
}
|
|
});
|
|
$('#fields_js').val(new_input);
|
|
}
|
|
};
|
|
|
|
$(function()
|
|
{
|
|
ViewManager.init();
|
|
}); |