Kendo UI window not centering for you?
Let's look at the code (/Scripts/App/store.js).
_openWindow = function (template, viewModel) { // Create a placeholder element. var window = $(document.createElement('div')); // Apply template to the placeholder element, and bind the viewmodel. var templateHtml = $(template).html(); window.html(kendo.template(templateHtml)(viewModel)); kendo.bind(window, viewModel); // Add window placeholder to the body. $('body').append(window); // Turn placeholder into a Window widget. window.kendoWindow({ width: config.albumDetailsWindowWidth, title: viewModel.data.Title, resizable: false, close: function () { // When the window is closed, remove the element from the document. window.parents(".k-window").remove(); } }); // Center and show the Window. window.data("kendoWindow").center(); window.data("kendoWindow").open(); },
First, you can chain the center and open together. Does this fix the centering issue? No. But it's less code.
Comments
Post a Comment