var k_window = $(selector),
k_undo = $(button)
.bind("click", function () {
k_window.data("kendoWindow").open();
k_undo.hide();
});
var onClose = function () {
k_undo.show();
};
if (!k_window.data("kendoWindow")) {
k_window.kendoWindow({
width: "600px",
title: "Lorem ipsum dolor sit",
actions: [
"Pin",
"Minimize",
"Maximize",
"Close"
],
close: onClose
});
}