jqr-helpers 1.0.54 → 1.0.55

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTQ0MTgzMDg4MDZiYWY2YmZkNjQ2NDYyMzY1NjdmMDhhNzZkZTk3Nw==
4
+ MDQxYmUwMjdhZmU0ZjdkZmRjNTc1OTg4ZmI1NmUwZWM5NTI5M2U1Mw==
5
5
  data.tar.gz: !binary |-
6
- ZGE2YjExMzY5YjMzNWEyYjkzMTViN2QwYmJiMzdkMDE1Y2UxNWJkZg==
6
+ OTA3NDQ4OTYwZTZkZDhiMTgzMjljMTg2ODQ3MGZmMTBhMWZlNGViMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OGM4ZWI5NjA0YTkzYzZjOGM2YTFkODZmYjEzNGZmODFmZjBkYzAwMTA0YjZj
10
- OTJhYzA0NTg4MWJjYjNlYTA1YmQ2ZDkzNTJmOTE2Y2Q3MmUwMjcyNzk1NmFj
11
- MmE5ZTk5ZTllZWIxYWVhMmRhOGQ3MTIzYjU3NTRhM2FhMzNlODM=
9
+ NTc1MTEwYWFjMjM0NzQ1ZjM0NDU1OGNmZjBlYzAxODJjODgxMjhlMmI0MzU5
10
+ ZDVmYzM0NDdhMDdlNzM3MTA1NDJhMGJhMmNkNjBhZTdkMmMzZTcwNjdiNDky
11
+ MDg5OTJlYjM1MWI4N2QwZDZkY2ZhY2MzMTJiYzlmYjVmODI3NmU=
12
12
  data.tar.gz: !binary |-
13
- YjU4ZDc0NTMyODA0ZDRiMTI0ZTgzNDBkM2QyMzhlYmI4ODNlZWJjOGQzYzBi
14
- NzJiYTQzOWQzMmFjNjc0MTc1Y2NiYjAzZGM1OWNhMTEyZTAxMWU0OWE0OTg2
15
- NmUxNzY3NzVjMjRhN2YxNjA2NTI2MzVmZGU3ZWVhZjkxOTRmMDM=
13
+ ZWY2MzhkMDIzYWY0OWNjNDM3MzNhYTFhN2FmZjIwYTFkODE2Mjk2MzYzYjFk
14
+ NTE2ZTJjOTZmMGVmN2I0MDg3YzdkYTM0MTA1YTM4M2Y2MjViYTE1YzQwZTUy
15
+ MDE2ZjZmNjQ4OTZjNWU2Y2RmOGI1ZDBmYmE2OGI5YTE4MzkzMTQ=
@@ -397,7 +397,14 @@
397
397
 
398
398
  function ujsToggleClick() {
399
399
  var id = $(this).data('id');
400
+ var target = $('#' + id);
400
401
  $('#' + id).toggle();
402
+ if ($(target).is(':visible')) {
403
+ $(this).addClass('ujs-toggle-open').removeClass('ujs-toggle-closed');
404
+ }
405
+ else {
406
+ $(this).removeClass('ujs-toggle-open').addClass('ujs-toggle-closed');
407
+ }
401
408
  }
402
409
 
403
410
  function ujsLoadPlugins(event) {
data/jqr-helpers.gemspec CHANGED
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'jqr-helpers'
3
3
  s.require_paths = %w(. lib lib/jqr-helpers)
4
- s.version = '1.0.54'
5
- s.date = '2014-07-23'
4
+ s.version = '1.0.55'
5
+ s.date = '2014-08-15'
6
6
  s.summary = 'Helpers to print unobtrusive jQuery-UI tags.'
7
7
  s.description = <<-EOF
8
8
  This gem adds helper methods to create unobtrusive jQuery code. It outputs
@@ -385,14 +385,16 @@ module JqrHelpers
385
385
  content_tag(:button, content, options)
386
386
  end
387
387
 
388
- # Add a link which toggles the visibility of a separate element.
388
+ # Add a link which toggles the visibility of a separate element. The link
389
+ # element itself will be given the class "ujs-toggle-open" and
390
+ # "ujs-toggle-closed" so you can style it.
389
391
  # @param body [String] the text for the link.
390
392
  # @param id [String] the ID of the element to toggle.
391
393
  # @param options [Hash] HTML options for the link.
392
394
  def link_to_toggle(body, id, options={})
393
395
  tag_name = options.delete(:tag_name) || :a
394
396
  options[:class] ||= ''
395
- options[:class] << ' ujs-toggle'
397
+ options[:class] << ' ujs-toggle ujs-toggle-closed'
396
398
  content_tag tag_name, body, options.merge(:'data-id' => id)
397
399
  end
398
400
 
@@ -1,6 +1,6 @@
1
1
  module JqrHelpers
2
2
  # @private
3
3
  module Rails
4
- VERSION = '1.0.54'
4
+ VERSION = '1.0.55'
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jqr-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.54
4
+ version: 1.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Orner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement