lib/opal/react/window.rb in opal-react-0.0.4 vs lib/opal/react/window.rb in opal-react-0.0.5

- old
+ new

@@ -1,25 +1,31 @@ module React module Window - [ - # Properties + + [ # Properties :closed, :console, :controllers, :crypto, :devicePixelRatio, :dialogArguments, :document, :frameElement, :frames, :fullscreen, :history, :indexedDB, :innerHeight, :innerWidth, :isSecureContext, :length, :localStorage, :location, :locationbar, :menubar, :messageManager, :name, :navigator, :opener, :outerHeight, :outerWidth, :parent, :performance, :personalbar, :screen, :screenX, :screenY, :scrollbars, :scrollX, :scrollY, :sessionStorage, :status, :statusbar, :toolbar, :top, :URL, :window, - # Methods + ].each { |key| define_method(key){ $$.window[key] } } + + [ # Methods :alert, :atob, :blur, :btoa, :cancelAnimationFrame, :cancelIdleCallback, :clearImmediate, :clearInterval, :clearTimeout, :close, :confirm, :convertPointFromNodeToPage, :createImageBitmap, :fetch, :focus, :forward, :getAttention, :getComputedStyle, :getDefaultComputedStyle, :getSelection, :home, :matchMedia, :minimize, :moveBy, :moveTo, :open, :postMessage, :prompt, :requestAnimationFrame, :requestIdleCallback, :resizeBy, :resizeTo, :restore, :scroll, :scrollBy, :scrollByPages, - :scrollTo, :setImmediate, :setInterval, :setTimeout, :sizeToContent, + :scrollTo, :setInterval, :setImmediate, :setTimeout, :sizeToContent, :stop, :updateCommands - ].each { |key| define_method(key){ $$.window[key] } } + ].each { |key| + define_method(key) { |*args, &block| + $$.window[key].call(*args, &block) + }} + end end \ No newline at end of file