8

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=3daa464d05b5

Chrome 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.

4

Thanks for the diagnostics, surprisingly this is not a bug related to the jQuery upgrade. It has been there since I initially implemented it.

Fixed now.

The escape key was removing the prototype for the rejection dialog.

  • fyi, not deployed yet – waffles Jan 19 '12 at 4:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .