This is a migrated thread and some comments may be shown as answers.

[Solved] Telerik Window Center positioning

1 Answer 147 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Abiy
Top achievements
Rank 1
Abiy asked on 12 Oct 2011, 08:02 PM
I recently updated my telerik resources from 2010.3.1110 to 2011.2.712 and everything went smoothly with the exception of some known breaking changes on Numeric text and Grid. But as these changes are documented properly I was able to figure out what to do with little effort.

But for some reason the window's center method was changed from:

  center: function () {
            var e = d(this.element);
            var f = d(window);
            e.css({ left: f.scrollLeft() + (f.width() - e.width()) / 2, top: f.scrollTop() + (f.height() - e.height()) / 2 });
            return this;
        }
to:
center: function () {
            var g = d(this.element);
            var e = d(window);
            var  f = d(document.body);
            g.css({ left: e.scrollLeft() + f.scrollLeft() + Math.max(0, (e.width() - g.width()) / 2), top: e.scrollTop() + f.scrollTop() + Math.max(0, (e.height() - g.height()) / 2) });
            return this;
        },

As you see the new functions considers document.body in determining the center, I assume there is good reason for the change though it does not center the window in chrome for me.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Oct 2011, 07:32 AM
Hello Abiy,

The code in 2011.2.712 is no longer considered correct due to cross-browser differences and we have changed it. If you upgrade to 2011.2.914, centering should work better.

Best wishes,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Window
Asked by
Abiy
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or