The Reject button cannot be clicked again when closing the Reject screen using ESC.
Steps to reproduce
- Visit the Suggested edits screen (or an individual suggested edit).
- Hit the Reject button (a screen appears).
- Use ESC to close the Reject screen.
- Hit any Reject button (= not necessarily the just-clicked one).
- The following message(s) shows up in my console:
Firefox 9:
c is null
Line 1, http://cdn.sstatic.net/js/stub.js?v=3daa464d05b5Chrome 17
Uncaught TypeError: Cannot read property 'top' of null
stub.js:1
The error might be related to the recent jQuery upgrade. I located the error to be at StackExchange.init.createJqueryExtensions
:
center: function () {
var d = this.parent();
if (d.css("position") === "static") {
d = d.offsetParent()
}
// Apparently, d is not an element, and the following line returns undefined
var c = d.offset();
this.css("position", "absolute");
this.css("top", ($(window).height() - this.height()) / 2
+ $(window).scrollTop() - c.top + "px");
this.css("left", ($(window).width() - this.width()) / 2
+ $(window).scrollLeft() - c.left + "px");
return this
},
Side note, this piece code can be optimized by storing $(window)
in a temporary variable, since it's called four times.