Admin settings updated with add new setting feature
This commit is contained in:
@@ -36,6 +36,7 @@ var rc = {
|
||||
success: function(d, s, x) {
|
||||
rc.page.update(d);
|
||||
rc.dialog.prepare(d);
|
||||
rc.trigger_all(d);
|
||||
},
|
||||
|
||||
failure: function(x, s, e) {
|
||||
@@ -93,9 +94,16 @@ var rc = {
|
||||
},
|
||||
|
||||
close: function() {
|
||||
// Hide the dialog
|
||||
$("#dialog").hide();
|
||||
$(".dialogfooterbuttonset").hide();
|
||||
|
||||
// Remove the dialog content
|
||||
$("#dialogcontent").html();
|
||||
|
||||
// Hide all buttons
|
||||
$(".dialogfooterbuttonset").hide();
|
||||
// Strip all event handlers
|
||||
$(".dialogfooterbuttonset input[type='button']").unbind('click');
|
||||
}
|
||||
|
||||
},
|
||||
@@ -136,8 +144,11 @@ var rc = {
|
||||
},
|
||||
|
||||
'add-setting': function(params) {
|
||||
// TODO
|
||||
console.log('todo');
|
||||
rc.ajax.post(base_url + 'ajax/admin/add-setting/name/' + $('#'+params.name).val() + '/type/' + $('#'+params.type).val() + '/');
|
||||
},
|
||||
|
||||
'add_setting_row': function(params) {
|
||||
$("#settings tbody").append(params.content);
|
||||
}
|
||||
|
||||
},
|
||||
@@ -159,6 +170,14 @@ var rc = {
|
||||
}
|
||||
},
|
||||
|
||||
trigger_all: function(params) {
|
||||
if (params.actions) {
|
||||
for (var action in params.actions) {
|
||||
rc.trigger(action, params.actions[action]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
settings: {
|
||||
|
||||
init: function() {
|
||||
|
||||
Reference in New Issue
Block a user