Sha256: 4cb368dc69a0fbfd71ebc0f649c134310cb1b42435b317182f9aa48cba01c242
Contents?: true
Size: 1.32 KB
Versions: 24
Compression:
Stored size: 1.32 KB
Contents
<% content_for('final') do %> <script type="text/javascript" charset="utf-8"> Test.context("SC.window event handlers", { "Should stop events when handled": function() { var e = SC.Mock.KeyEvent.create({ type: 'keyup', keyCode: 65 }); SC.window.keyUp = function(e) { this.keyUpWasHandled = true; }; SC.window._onkeyup(e).shouldEqual(false); SC.window.keyUpWasHandled.shouldEqual(true); e.stopped.shouldEqual(true); }, "Should not stop events when handler sets the event's _stopWhenHandled property to false": function() { var e = SC.Mock.KeyEvent.create({ type: 'keyup', keyCode: 65 }); SC.window.keyUp = function(e) { e._stopWhenHandled = false; this.keyUpWasHandled = true; }; SC.window._onkeyup(e).shouldEqual(true); SC.window.keyUpWasHandled.shouldEqual(true); e.stopped.shouldEqual(false); }, "Should not stop events when the event's _stopWhenHandled property is false *before* being sent to the handler": function() { var e = SC.Mock.KeyEvent.create({ type: 'keyup', keyCode: 65, _stopWhenHandled: false }); SC.window.keyUp = function(e) { this.keyUpWasHandled = true; }; SC.window._onkeyup(e).shouldEqual(true); SC.window.keyUpWasHandled.shouldEqual(true); e.stopped.shouldEqual(false); }, setup: function() { } }); </script> <% end %>
Version data entries
24 entries across 24 versions & 1 rubygems