W3C home > Mailing lists > Public > www-archive@w3.org > August 2012

showAlert() patch

From: Simon Pieters <simonp@opera.com>
Date: Wed, 15 Aug 2012 11:50:49 +0200
To: "Ian Hickson" <ian@hixie.ch>
Cc: "www-archive@w3.org" <www-archive@w3.org>
Message-ID: <op.wi2tmzd7idj3kv@device-23f190>
Re http://krijnhoetmer.nl/irc-logs/whatwg/20120604#l-615

The script is inline in the spec. In the showAlert() function, just after  
the line:

        document.body.appendChild(currentAlert);

add:

        x.focus();


also change:

    window.addEventListener('keydown', function (event) {
      if (event.keyCode == 27) {
        if (currentAlert)
          closeAlert2();
      } else {
        closeAlert();
      }
    }, false);

to:

    window.addEventListener('keydown', function (event) {
      if (event.keyCode == 27) {
        if (currentAlert)
          closeAlert2();
      }
    }, false);


and remove:

    window.addEventListener('scroll', function (event) {
      closeAlert();
    }, false);


Thanks!

-- 
Simon Pieters
Opera Software
Received on Wednesday, 15 August 2012 09:51:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:18:55 GMT