Skip to content

fixed readme's event types #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

aostrega
Copy link

An event listener for 'dom:load' does not fire for me in Chromium and Firefox, but using 'load' or 'DOMContentLoaded' works.

@meh
Copy link
Member

meh commented Jan 26, 2014

Nope, it's dom:load now, had to change it because load is an actual event for images.

load doesn't work in all browsers, dom:load gets converted to DOMContentLoaded.

@meh meh closed this Jan 26, 2014
@aostrega
Copy link
Author

I see. Using $document.on 'dom:load' does not work for me with opal-browser 0.1.0.beta1; any idea what the cause could be?

EDIT: Looks like 'dom:load' is pretty recent, so I imagine that the rubygems gem has simply not been updated yet.

@meh
Copy link
Member

meh commented Jan 26, 2014

Can you try on master please? I'll release a beta2 as soon as I have it working on IE8, should be later tomorrow.

@aostrega
Copy link
Author

No prob. Using the latest github master raises a Sprockets::FileNotFound error in my Rails/Opal project.

couldn't find file 'promise' 
  (in /home/artur/.rvm/gems/ruby-2.0.0-p247/bundler/gems/opal-browser-be6054385e96/opal/browser/canvas.rb)

@meh
Copy link
Member

meh commented Jan 26, 2014

You'll need opal master as well.

@aostrega
Copy link
Author

A strange opal-rails Bundler dependency error is preventing me from using opal master.

Bundler could not find compatible versions for gem "opal":
  In Gemfile:
    opal-rails (>= 0) ruby depends on
      opal (~> 0.5.0) ruby

    opal (0.6.0)

What makes it strange is that opal-rails master clearly requires at least opal 0.6.0 (the current master) in its .gemspec. https://github.com/opal/opal-rails/blob/master/opal-rails.gemspec#L23

My project's Gemfile:

source 'https://rubygems.org'

gem 'rails', '4.0.2'
gem 'haml-rails'
gem 'sass-rails', '~> 4.0.0'
gem 'opal', github: 'opal/opal', branch: 'master'
gem 'opal-rails', github: 'opal/opal-rails', branch: 'master'
gem 'opal-browser', github: 'opal/opal-browser', branch: 'master'
gem 'uglifier', '>= 1.3.0'
gem 'turbolinks'
gem 'debugger', group: [:development, :test]

@meh
Copy link
Member

meh commented Jan 26, 2014

Anything that might be cached by bundler?

Try removing .bundle and the Gemfile.lock (and the --path you gave bundle install if you gave one at all).

Otherwise @elia, any idea?

@aostrega
Copy link
Author

I had removed Gemfile.lock to no avail and there is no .bundle.

A fresh project with the Gemfile below shows the same error after running bundle install.

source 'https://rubygems.org'

gem 'opal', github: 'opal/opal', branch: 'master'
gem 'opal-rails', github: 'opal/opal-rails', branch: 'master'

Using ruby 2.0.0p247 (2013-06-27 revision 41674) [i686-linux], Bundler version 1.3.5.

@meh
Copy link
Member

meh commented Jan 26, 2014

Yeah, I'm out of ideas, @elia will know more, but Italy is asleep now, as I'm about to as well.

@aostrega
Copy link
Author

Ah, the Bundler error was misleading! opal-rails requires opal-jquery, and the release version of that requires opal ~> 0.5.0. Bundling opal-jquery master before opal-rails fixed it.


At any rate, using dom:load as an event type works for me with opal-browser master.

@elia
Copy link
Member

elia commented Jan 26, 2014

Use bundler a prerelease version to get meaningful errors :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants