Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Try waiting, so appending jQuery works first.

  • Loading branch information...
commit b7f0bbb719ad681e9da8a0e053e5869de0b5f99d 1 parent aaf907d
@nakajima authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 app/models/bookmarklet.rb
View
9 app/models/bookmarklet.rb
@@ -20,7 +20,14 @@ def code
document.getElementsByTagName('head')[0].appendChild(_jq);
JS
jquery.gsub!(/^\s*/, '')
- [jquery, self[:code]].join("\n")
+
+ wrapped_code = <<-JS
+ window.setTimeout(function() {
+ #{self[:code]}
+ }, 10);
+ JS
+
+ [jquery, wrapped_code].join("\n")
else
self[:code]
end
Please sign in to comment.
Something went wrong with that request. Please try again.