Make fox look away while typing password

Inspired by this tweet:
https://twitter.com/Aashay/status/858791285976481792
feature/default_network_editable
Dan Finlay 8 years ago
parent 753de30b3b
commit 89b0d3d403
  1. 12
      ui/app/unlock.js

@ -109,10 +109,10 @@ UnlockScreen.prototype.submitPassword = function (event) {
UnlockScreen.prototype.inputChanged = function (event) {
// tell mascot to look at page action
var element = event.target
var boundingRect = element.getBoundingClientRect()
var coordinates = getCaretCoordinates(element, element.selectionEnd)
this.animationEventEmitter.emit('point', {
x: boundingRect.left + coordinates.left - element.scrollLeft,
y: boundingRect.top + coordinates.top - element.scrollTop,
})
var viewRect = element.getBoundingClientRect()
var carat = getCaretCoordinates(element, element.selectionEnd)
var x = viewRect.right - carat.left + element.scrollLeft
var y = 300
var pointAt = { x, y }
this.animationEventEmitter.emit('point', pointAt)
}

Loading…
Cancel
Save