Permalink
Browse files

uri_to_icon now works on instance level

  • Loading branch information...
1 parent 9c22a57 commit d8991eb9bf84c3f8d333049bd9c0a55aa626335a nomadcoder committed Nov 7, 2012
View
@@ -5,7 +5,6 @@ Manifest
.DS_Store
test/core_test_app/tmp/
test/core_test_app/public/extjs*
-test/core_test_app/public/images/icons
test/core_test_app/vendor/gems/netzke-persistence
test/core_test_app/public/javascripts
test/core_test_app/public/stylesheets
View
@@ -102,5 +102,11 @@ def actions
def js_config_with_actions #:nodoc
actions.empty? ? js_config_without_actions : js_config_without_actions.merge(:actions => actions)
end
+
+ protected
+
+ def uri_to_icon(icon)
+ self.class.uri_to_icon(icon)
+ end
end
end
View
@@ -206,6 +206,9 @@ Gem::Specification.new do |s|
"test/core_test_app/public/422.html",
"test/core_test_app/public/500.html",
"test/core_test_app/public/favicon.ico",
+ "test/core_test_app/public/images/icons/accept.png",
+ "test/core_test_app/public/images/icons/anchor.png",
+ "test/core_test_app/public/images/icons/tick.png",
"test/core_test_app/public/images/rails.png",
"test/core_test_app/public/robots.txt",
"test/core_test_app/script/rails",
@@ -1,13 +1,13 @@
class ComponentWithActions < Netzke::Base
action :some_action do |a|
a.text = "Some Cool Action"
- a.icon = Netzke::Core.icons_uri + "/tick.png" # specify full icon path
+ a.icon = Netzke::Core.icons_uri + "/tick.png" # specify full icon uri
end
action :another_action do |a|
a.disabled = true
a.text = "Disabled action"
- a.icon = :accept # the accept.png icon will be looked for in Netzke::Core.icons_uri
+ a.icon = :accept # accept.png icon will be looked for in Netzke::Core.icons_uri
end
action :action_with_custom_handler do |c|
@@ -34,8 +34,7 @@ def configure(c)
:text => 'Menu Button',
:scale => 'large',
:rowspan => 3,
- :iconCls => 'add',
- :iconAlign => 'top',
+ icon: uri_to_icon(:anchor), # use uri_to_icon helper to get the full icon uri
:arrowAlign => 'bottom',
:menu => [:some_action]
},{
@@ -1,11 +1,7 @@
class SimpleAuthenticationComponent < Netzke::Base
- action :sign_in do |c|
- c.icon = :door_in
- end
+ action :sign_in
- action :sign_out do |c|
- c.icon = :door_out
- end
+ action :sign_out
def configure(c)
super
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d8991eb

Please sign in to comment.