bug 12266

- Show 'delete' instead of 'create' in dialog
- Select domain's parent upon deletion, for UI consistency
This commit is contained in:
Brian Federle 2011-12-02 15:39:17 -08:00
parent fdb21b5521
commit e7c4bc48fd
2 changed files with 99 additions and 91 deletions

View File

@ -28,6 +28,7 @@
createForm: {
title: 'Delete domain',
createLabel: 'Delete',
preFilter: function(args) {
if(isAdmin()) {
args.$form.find('.form-item[rel=isForced]').css('display', 'inline-block');
@ -58,6 +59,12 @@
{jobId: jid}
}
);
// Quick fix for proper UI reaction to delete domain
var $item = $('.name.selected').closest('li');
var $itemParent = $item.closest('li');
$itemParent.parent().parent().find('.name:first').click();
$item.remove();
}
});
},

View File

@ -21,6 +21,7 @@
var $formContainer = $('<div>').addClass('form-container');
var $message = $('<span>').addClass('message').appendTo($formContainer).html(args.form.desc);
var $form = $('<form>').appendTo($formContainer);
var createLabel = args.form.createLabel;
// Render fields and events
$.each(args.form.fields, function(key, field) {
@ -297,7 +298,7 @@
},
buttons: [
{
text: 'Create',
text: createLabel ? createLabel : 'Create',
'class': 'ok',
click: function() {
if (!complete($formContainer)) { return false; }