inital commit
This commit is contained in:
53
webroot/forum/admin/jscripts/view_manager.js
Normal file
53
webroot/forum/admin/jscripts/view_manager.js
Normal file
@@ -0,0 +1,53 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user