rjs_helpers 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ /.idea
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/rjs_helpers.png)](http://badge.fury.io/rb/rjs_helpers)
2
+
1
3
  RJS Helpers
2
4
  ==============
3
5
 
@@ -6,9 +8,24 @@ Some helper methods to perform standard JS library tasks from js.erb without hav
6
8
  Installation
7
9
  ============
8
10
 
11
+ As a plugin
12
+ -----------
13
+
9
14
  To install the plugin in your Rails 2.3 application, simply run
10
15
 
11
16
  ruby script/plugin install https://github.com/Stex/rjs_helpers.git
17
+
18
+ As a gem
19
+ --------
20
+
21
+ To install `rjs_helpers` as a gem, run
22
+
23
+ gem install rjs_helpers
24
+
25
+ or put this into your `Gemfile`:
26
+
27
+ gem 'rjs_helpers'
28
+
12
29
 
13
30
  This will automatically load the Rails helper into all your controllers.
14
31
  As explained below, the plugin ships with a default JS adapter for jQuery
@@ -80,8 +80,9 @@ window.rjsHelpers =
80
80
  }, 1000)
81
81
  false
82
82
 
83
- scrollToElementById: (element) ->
84
- @.scrollToElement("##{element}")
83
+ scrollToElementById: (element, offsetTop) ->
84
+ offsetTop = 0 unless offsetTop?
85
+ @.scrollToElement("##{element}", offsetTop)
85
86
 
86
87
  scrollToTop: (offsetTop) ->
87
88
  offsetTop = 0 unless offsetTop?
@@ -1,4 +1,4 @@
1
- // Generated by CoffeeScript 1.3.3
1
+ // Generated by CoffeeScript 1.4.0
2
2
  (function() {
3
3
 
4
4
  window.rjsHelpers = {
@@ -59,8 +59,11 @@
59
59
  }, 1000);
60
60
  return false;
61
61
  },
62
- scrollToElementById: function(element) {
63
- return this.scrollToElement("#" + element);
62
+ scrollToElementById: function(element, offsetTop) {
63
+ if (offsetTop == null) {
64
+ offsetTop = 0;
65
+ }
66
+ return this.scrollToElement("#" + element, offsetTop);
64
67
  },
65
68
  scrollToTop: function(offsetTop) {
66
69
  if (offsetTop == null) {
@@ -1,3 +1,3 @@
1
1
  module RjsHelpers
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rjs_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stefan Exner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-09-10 00:00:00 Z
18
+ date: 2013-11-04 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: bundler
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements: []
123
123
 
124
124
  rubyforge_project:
125
- rubygems_version: 1.8.26
125
+ rubygems_version: 1.8.22
126
126
  signing_key:
127
127
  specification_version: 3
128
128
  summary: Some helper methods to perform standard JS library tasks from js.erb without having to write actual javascript