Sha256: 10af2112f97b50ec017a19d3badea50ce607d24bd5d54a297b6203ef56a9b328

Contents?: true

Size: 501 Bytes

Versions: 6

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

class Scarpe
  class GlimmerLibUILink < GlimmerLibUIWidget
    def initialize(properties)
      super

      bind("click") do
        send_self_event(event_name: "click")
      end
    end

    def element
      HTML.render do |h|
        h.a(**attributes) do
          @text
        end
      end
    end

    def attributes
      {
        id: html_id,
        href: @click,
        onclick: (handler_js_code("click") if @has_block),
      }.compact
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 spikes/glibui/link.rb
scarpe-0.3.0 spikes/glibui/link.rb
scarpe-0.2.2 spikes/glibui/link.rb
lacci-0.2.1 lib/scarpe/glibui/link.rb
scarpe-0.2.1 lib/scarpe/glibui/link.rb
scarpe-0.2.0 lib/scarpe/glibui/link.rb