Sha256: 0d90b09c24d379f84053eedd56aba2c26fc48bfe3094966d58248bf3368254bb

Contents?: true

Size: 1.43 KB

Versions: 8

Compression:

Stored size: 1.43 KB

Contents

<!DOCTYPE html>
<html>
<!--
Copyright 2010 The Closure Library Authors. All Rights Reserved.

Use of this source code is governed by the Apache License, Version 2.0.
See the COPYING file for details.
-->
<head>
<title>goog.events.FocusHandler</title>
<script src="../base.js"></script>
<script>
goog.require('goog.dom');
goog.require('goog.events');
goog.require('goog.events.FocusHandler');
</script>
<link rel="stylesheet" href="css/demo.css">
</head>
<body>
<h1>goog.events.FocusHandler</h1>
<p>i1: <input id=i1>


<p>i2 <input id=i2>


<p>i3: <input id=i3>

<p id=out>

<script>

var $ = goog.dom.getElement;

function updateText(e) {
  var target = e.target;
  $('out').appendChild(document.createTextNode(target.tagName + "#" +
                                               target.id + ": " + e.type));
  $('out').appendChild(document.createElement('br'));
}

var focusHandler = new goog.events.FocusHandler(document.body);

goog.events.listen(focusHandler, goog.events.FocusHandler.EventType.FOCUSIN,
                   updateText);
goog.events.listen(focusHandler, goog.events.FocusHandler.EventType.FOCUSOUT,
                   updateText);

goog.events.listen(window, 'unload', function() {
  goog.events.unlisten(focusHandler, goog.events.FocusHandler.EventType.FOCUSIN,
                       updateText);
  goog.events.unlisten(focusHandler,
                       goog.events.FocusHandler.EventType.FOCUSOUT, updateText);
});

</script>
</body>
</html>

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
k4compiler-0.0.1 third_party/closure-library/closure/goog/demos/focushandler.html
middleman-wizard-template-1.0.4 lib/middleman-wizard-template/template/closure/library/closure/goog/demos/focushandler.html
middleman-wizard-template-1.0.3 lib/middleman-wizard-template/template/closure/library/closure/goog/demos/focushandler.html
middleman-wizard-template-1.0.2 lib/middleman-wizard-template/template/closure/library/closure/goog/demos/focushandler.html
middleman-wizard-template-1.0.1 lib/middleman-wizard-template/template/closure/library/closure/goog/demos/focushandler.html
middleman-wizard-template-1.0.0.pre.1 lib/middleman-wizard-template/template/closure/library/closure/goog/demos/focushandler.html
closure-1.2.701 closure-library/closure/goog/demos/focushandler.html
closure-1.1.692 closure-library/closure/goog/demos/focushandler.html