Skip to content

Commit

Permalink
Merge pull request #8 from skateman/treeview-fonticon-support
Browse files Browse the repository at this point in the history
Support for fonticons using the icon attribute in TreeNode subclasses
  • Loading branch information
himdel authored Dec 23, 2016
2 parents 1545a1b + 53477bc commit 5273d7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/presenters/tree_node/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class Hash < Node

set_attribute(:image) { @object[:image] }

set_attribute(:icon) { @object[:icon] }

set_attribute(:no_click) { @object.key?(:cfmeNoClick) && @object[:cfmeNoClick] ? true : nil }

set_attribute(:hide_checkbox) { @object.key?(:hideCheckbox) && @object[:hideCheckbox] ? true : nil }
Expand Down
5 changes: 5 additions & 0 deletions app/presenters/tree_node/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def tooltip
nil
end

def icon
nil
end

def klass
nil
end
Expand Down Expand Up @@ -112,6 +116,7 @@ def to_h
node = {
:key => key,
:title => text ? text : title,
:icon => icon,
:expand => expand,
:hideCheckbox => hide_checkbox ? hide_checkbox : nil,
:addClass => klass,
Expand Down

0 comments on commit 5273d7b

Please sign in to comment.