Add editorconfig, resolve differences

This includes newlines, tabs, among other things.
This commit is contained in:
impinball 2016-06-18 02:59:42 -04:00
parent 80d0a69dab
commit b4fb21475c
90 changed files with 1707 additions and 1701 deletions

View file

@ -17,79 +17,79 @@ o.spec("autoredraw", function() {
pubsub = apiPubSub()
spy = o.spy()
})
o("returns self-trigger", function() {
var run = autoredraw(root, renderer, pubsub, spy)
run()
o(spy.callCount).equals(1)
})
o("null renderer doesn't throw", function(done) {
autoredraw(root, null, pubsub, spy)
done()
})
o("null pubsub doesn't throw", function(done) {
autoredraw(root, renderer, null, spy)
done()
})
o("registers onevent", function() {
autoredraw(root, renderer, pubsub, spy)
renderer.render(root, {tag: "div", attrs: {onclick: function() {}}})
var e = $window.document.createEvent("MouseEvents")
e.initEvent("click", true, true)
root.firstChild.dispatchEvent(e)
o(spy.callCount).equals(1)
})
o("registers pubsub", function() {
autoredraw(root, renderer, pubsub, spy)
pubsub.publish()
o(spy.callCount).equals(1)
})
o("re-registering pubsub works", function() {
autoredraw(root, renderer, pubsub, spy)
autoredraw(root, renderer, pubsub, spy)
pubsub.publish()
o(spy.callCount).equals(1)
})
o("throttles", function(done) {
var run = autoredraw(root, renderer, pubsub, spy)
run()
run()
o(spy.callCount).equals(1)
setTimeout(function() {
o(spy.callCount).equals(2)
done()
}, FRAME_BUDGET)
})
o("does not redraw if e.redraw is false", function() {
autoredraw(root, renderer, pubsub, spy)
renderer.render(root, {tag: "div", attrs: {onclick: function(e) {e.redraw = false}}})
var e = $window.document.createEvent("MouseEvents")
e.initEvent("click", true, true)
root.firstChild.dispatchEvent(e)
o(spy.callCount).equals(0)
})
})
})