Sha256: 012b0e113f8216115e3130883983229a4e989a6b8c227ff09db4e8e4b9af9cc0
Contents?: true
Size: 852 Bytes
Versions: 5
Compression:
Stored size: 852 Bytes
Contents
module Browser; module DOM class Element < Node # @!attribute editable # @return [Boolean?] the value of contentEditable for this element def editable case `#@native.contentEditable` when "true" true when "false" false when "inherit" nil end end def editable=(value) value = case value when true "true" when false "false" when nil "inherit" end `#@native.contentEditable = #{value}` end def editable? `#@native.isContentEditable` end # Execute a contentEditable command def edit(command, value=nil) command = command.gsub(/_./) { |i| i[1].upcase } focus if value `#{document}.native.execCommand(#{command}, false, #{value})` else `#{document}.native.execCommand(#{command}, false)` end end end end; end
Version data entries
5 entries across 5 versions & 2 rubygems