Commit e37d4118e239242edd33de77243a4d6fe01e50f4

Authored by AntonioTerceiro
1 parent 9ce6f648

ActionItem152: hiding text for buttons that are icon-button's


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1239 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/helpers/application_helper.rb
... ... @@ -252,16 +252,16 @@ module ApplicationHelper
252 252 show_button_id = id + "-show"
253 253  
254 254 result = ""
255   - result << button_to_function('open', show_label, show(id) + show(hide_button_id) + hide(show_button_id), :id => show_button_id, :class => 'show-button with_text', :style => 'display: none;' )
  255 + result << button_to_function('open', show_label, show(id) + show(hide_button_id) + hide(show_button_id), :id => show_button_id, :class => 'show-button with-text', :style => 'display: none;' )
256 256  
257 257 result < " "
258   - result << button_to_function('close', hide_label, hide(id) + hide(hide_button_id) + show(show_button_id), :id => hide_button_id, :class => 'hide-button with_text')
  258 + result << button_to_function('close', hide_label, hide(id) + hide(hide_button_id) + show(show_button_id), :id => hide_button_id, :class => 'hide-button with-text')
259 259  
260 260 result
261 261 end
262 262  
263 263 def button(type, label, url, html_options = {})
264   - the_class = "button with_text #{type}"
  264 + the_class = "button with-text #{type}"
265 265 if html_options.has_key?(:class)
266 266 the_class << ' ' << html_options[:class]
267 267 end
... ... @@ -273,7 +273,7 @@ module ApplicationHelper
273 273  
274 274 html_options[:class] = [html_options[:class], 'submit'].compact.join(' ')
275 275  
276   - the_class = "button with_text #{type}"
  276 + the_class = "button with-text #{type}"
277 277 if html_options.has_key?(:class)
278 278 the_class << ' ' << html_options[:class]
279 279 end
... ... @@ -298,7 +298,7 @@ module ApplicationHelper
298 298 end
299 299  
300 300 def icon_button(type, text, url, html_options = {})
301   - the_class = "button #{type}"
  301 + the_class = "button icon-button #{type}"
302 302 if html_options.has_key?(:class)
303 303 the_class << ' ' << html_options[:class]
304 304 end
... ...
public/stylesheets/button.css
... ... @@ -43,3 +43,16 @@ input.button {
43 43 cursor: pointer;
44 44 }
45 45  
  46 +.button span {
  47 + display: none;
  48 +}
  49 +.button.with-text span {
  50 + display: inline;
  51 +}
  52 +
  53 +.icon-button {
  54 + border: none;
  55 +}
  56 +.icon-button:hover {
  57 + border: none;
  58 +}
... ...