ajaxify_rails 0.8.5 → 0.8.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 003a87a85d738faa2136e56ede3595c2fd82f1ed
4
- data.tar.gz: 5fb1b3dba67cb9d46812dbbf5f5a4e59b1c1aeed
3
+ metadata.gz: ba0012c77ba9a8760e3fb98f3dc17b8886a7926b
4
+ data.tar.gz: aeb1a058cb4635e143fb4a9ca4504b2cd565d388
5
5
  SHA512:
6
- metadata.gz: e24f2baf7d1230ffcf866b640ba87eb1f4b6b271cf0044bb74a24cd9b94f5294de6819be46541111f5b8a03b3f831b8261a43893f014cc77db92d19c5109b601
7
- data.tar.gz: 62e222d3398aa1a1e4c8ce2b96a2323f23080ceef9df1ae86e6bf5f08688459d708b983685628bc1cb25f2747a5cb0526ed9a129857f8f24e9d1a264fc931552
6
+ metadata.gz: ebd48960b8abca1fb59949613e3ab34154ba5f4e62ad2f29963ad83b362e6984ff00d1f088fe33382d6bf516c99bfdf13b0804d88fb53c9bd7699589905c4470
7
+ data.tar.gz: 5bddacac291cd96d987d8a512c930d9a4770677f192efe210654e39f87700c88f2653f0c717a3f5e78ce0340f89c2f9846ab3d472a18cbdde8f7c05f34fe8b83
data/README.md CHANGED
@@ -90,7 +90,7 @@ It's a common use case to have a navigation that needs to change its appearence
90
90
  to a different section of the page. Ajaxify provides a success callback that is triggered after successful
91
91
  updates of the page's main content. Just bind to the `ajaxify:content_loaded' event and make your layout changes:
92
92
 
93
- $('body').on 'ajaxify:content_loaded', ->
93
+ $(document).on 'ajaxify:content_loaded', ->
94
94
  # update navigation and/or other layout elements
95
95
 
96
96
 
@@ -158,7 +158,7 @@ For example you could provide html for a widget in the layout like this:
158
158
 
159
159
  And then, on the client side bind to the `ajaxify:content_inserted` event and select the widget html via `#ajaxify_content`:
160
160
 
161
- $('body').on 'ajaxify:content_inserted', ->
161
+ $(document).on 'ajaxify:content_inserted', ->
162
162
  $('#my_fancy_widget').html $('#ajaxify_content #my_fancy_widget_html').html()
163
163
 
164
164
  Tip: you can call view helpers to render extra content from within your controller using the view_context:
@@ -1,3 +1,3 @@
1
1
  module AjaxifyRails
2
- VERSION = "0.8.5"
2
+ VERSION = "0.8.6"
3
3
  end
@@ -4,6 +4,7 @@ base_paths = null
4
4
  flash_types = ['notice']
5
5
  dont_correct_url = false
6
6
  push_state_enabled = true
7
+ loader_element = "<div class='ajaxify_loader'></div>"
7
8
 
8
9
  ignore_hash_change = null
9
10
  load_page_from_hash = null
@@ -31,6 +32,9 @@ get_content_container = ->
31
32
  set_content_container = (new_content_container) ->
32
33
  content_container = new_content_container
33
34
 
35
+ set_loader_element = (new_loader_element) ->
36
+ loader_element = new_loader_element
37
+
34
38
 
35
39
  init = (options = {}) ->
36
40
  base_paths = options.base_paths if 'base_paths' of options
@@ -132,7 +136,7 @@ load = (options, pop_state = false) ->
132
136
  type: type
133
137
  cache: true
134
138
  beforeSend: (xhr) ->
135
- $("##{content_container}").html( "<div class='ajaxify_loader'></div>" )
139
+ $("##{content_container}").html( loader_element )
136
140
  options.scroll_to_top = scroll_to_top unless 'scroll_to_top' of options
137
141
  scroll_page_to_top() if options.scroll_to_top
138
142
 
@@ -323,7 +327,7 @@ reload_page_if_assets_stale = (url, jqXHR) ->
323
327
  # <%= link_to 'test', test_path, :method => :delete %>
324
328
  rails_ujs_fix = ->
325
329
  return false unless 'rails' of jQuery
326
-
330
+
327
331
  jQuery.rails.handleMethod = (link) ->
328
332
  href = $.rails.href(link)
329
333
  method = link.data('method')
@@ -338,8 +342,8 @@ rails_ujs_fix = ->
338
342
  form.addClass('no_ajaxify') if link.hasClass('no_ajaxify')
339
343
 
340
344
  if csrf_param != undefined && csrf_token != undefined
341
- metadata_input += '<input name="' +
342
- csrf_param + '" value="' +
345
+ metadata_input += '<input name="' +
346
+ csrf_param + '" value="' +
343
347
  csrf_token + '" type="hidden" />'
344
348
 
345
349
  form.attr('target', target) if target
@@ -351,7 +355,7 @@ rails_ujs_fix = ->
351
355
  # public interface
352
356
  # --------------------------------------------------------------------------------------------------------------------
353
357
 
354
- @Ajaxify = { init, ajaxify, load, update_url, activate, set_content_container, get_content_container }
358
+ @Ajaxify = { init, ajaxify, load, update_url, activate, set_content_container, get_content_container, set_loader_element }
355
359
 
356
360
 
357
361
  # --------------------------------------------------------------------------------------------------------------------
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajaxify_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nico Ritsche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-08 00:00:00.000000000 Z
11
+ date: 2013-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails