start to unify and test listeners
This commit is contained in:
@ -1,6 +1,19 @@
|
||||
if RUBY_PLATFORM == 'opal'
|
||||
require "native"
|
||||
end
|
||||
|
||||
module Main
|
||||
class ObjectsController < Volt::ModelController
|
||||
|
||||
def index_ready
|
||||
container = Native(self.container).querySelector("ul")
|
||||
return unless container
|
||||
puts "li " + container.innerHTML + " lo"
|
||||
# red = -> (event) { container.style.backgroundColor = "red" }
|
||||
red = -> (event) { puts container.tagName }
|
||||
container.addEventListener("mouseenter" , red)
|
||||
end
|
||||
|
||||
def marker var
|
||||
return "Wo" if var.is_a? String
|
||||
var.class.name.split("::").last[0,2]
|
||||
|
Reference in New Issue
Block a user