[BlueOnyx:19234] Re: Feature Request - Display site name in deleteconfirmation
Jim Scott
jscott at infoconex.com
Mon Feb 29 18:57:58 -05 2016
Ok, here is my first contribution to BO
Change the following javascript in vsiteList. Note that I added comments just to explain my changes, I would expect those to be removed.I also refactored a bit the javascript to only get the confirm dialog element once.
I assume this is not likely the best place to contribute code changes so please let me know how you would prefer to have this suggested.
-------------------------------------
Modify the dialog h1 tag, replace the color attribute I added with some type of class to color if you agree it should be colored.
<h1>Are you sure you want to remove this virtual site <span color="brown" class="siteToRemove"></span> ?</h1>
------------------------------------
Modify the javascript that initializes the dialog and sets up the click event
// Get dialog element once
var confirmDelete = $("#dialog");
// Initialize Dialog
confirmDelete.dialog({
modal: true,
bgiframe: true,
width: 500,
height: 280,
autoOpen: false
});
// Setup click event for delete button for each vsite
$(".lb").click(function (e) {
e.preventDefault();
// Get reference to lb clicked
var lb = $(this);
// Grab url to be used to execute delete
var hrefAttribute = lb.attr("href");
// Get the vsite name for the lb clicked
var siteName = lb.closest('tr')
.find('.dt_0')
.text();
// Do vsite text replacement for site being deleted
confirmDelete.find('.siteToRemove')
.text(siteName);
// Setup remove/cancel actions
confirmDelete.dialog('option', 'buttons', {
"Remove": function () {
window.location.href = hrefAttribute;
},
"Cancel": function () {
$(this).dialog("close");
}
});
// open confirmatin dialog
confirmDelete.dialog("open");
});
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.blueonyx.it/pipermail/blueonyx/attachments/20160229/0061ef89/attachment.html>
More information about the Blueonyx
mailing list