Commit e37d4118e239242edd33de77243a4d6fe01e50f4
1 parent
9ce6f648
Exists in
master
and in
22 other branches
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
Showing
2 changed files
with
18 additions
and
5 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -252,16 +252,16 @@ module ApplicationHelper | @@ -252,16 +252,16 @@ module ApplicationHelper | ||
252 | show_button_id = id + "-show" | 252 | show_button_id = id + "-show" |
253 | 253 | ||
254 | result = "" | 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 | result < " " | 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 | result | 260 | result |
261 | end | 261 | end |
262 | 262 | ||
263 | def button(type, label, url, html_options = {}) | 263 | def button(type, label, url, html_options = {}) |
264 | - the_class = "button with_text #{type}" | 264 | + the_class = "button with-text #{type}" |
265 | if html_options.has_key?(:class) | 265 | if html_options.has_key?(:class) |
266 | the_class << ' ' << html_options[:class] | 266 | the_class << ' ' << html_options[:class] |
267 | end | 267 | end |
@@ -273,7 +273,7 @@ module ApplicationHelper | @@ -273,7 +273,7 @@ module ApplicationHelper | ||
273 | 273 | ||
274 | html_options[:class] = [html_options[:class], 'submit'].compact.join(' ') | 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 | if html_options.has_key?(:class) | 277 | if html_options.has_key?(:class) |
278 | the_class << ' ' << html_options[:class] | 278 | the_class << ' ' << html_options[:class] |
279 | end | 279 | end |
@@ -298,7 +298,7 @@ module ApplicationHelper | @@ -298,7 +298,7 @@ module ApplicationHelper | ||
298 | end | 298 | end |
299 | 299 | ||
300 | def icon_button(type, text, url, html_options = {}) | 300 | def icon_button(type, text, url, html_options = {}) |
301 | - the_class = "button #{type}" | 301 | + the_class = "button icon-button #{type}" |
302 | if html_options.has_key?(:class) | 302 | if html_options.has_key?(:class) |
303 | the_class << ' ' << html_options[:class] | 303 | the_class << ' ' << html_options[:class] |
304 | end | 304 | end |
public/stylesheets/button.css
@@ -43,3 +43,16 @@ input.button { | @@ -43,3 +43,16 @@ input.button { | ||
43 | cursor: pointer; | 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 | +} |