dynaspan 0.0.8 → 0.0.9

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: 1019cf38fd7e1d2eb0cfa56fb22404bedca8b65e
4
- data.tar.gz: 6ebc3ca05907ed90ce486a744ac1120e21ac1e11
3
+ metadata.gz: 98d6a9adf299b030cb5cc2a444d5bd4480b9a13c
4
+ data.tar.gz: d312099ffa1d0e843e4d4525802473ff588c264d
5
5
  SHA512:
6
- metadata.gz: b773f546b093324d1259e15c859b2084c70232ae58eb9487ad472dc5de5d0e5f227413de6b7e355a885c0b27d5e2046e4e3e7921565656c585ab74fa8b6629bd
7
- data.tar.gz: 4aee57e7c6e147fd4d0890007c8b2cef73f05b35b82f308cb45c36e7aad487693586f46f8846ad6565a550140bf2202fe0f1e3cf8fdc6e85ae78fbfdb23b12f8
6
+ metadata.gz: d44ed5db1cd4067d6b7763d9a6b4e778148ded767e0a39f3f13b66b596923ac968a90798703c5b6165af53950c2fef3c7b75a3e2bf2514ce4e1868e4b81a877e
7
+ data.tar.gz: 11472decede16e3f62ded5c0aaefbd099b0eaa07c2624eb6ca9cde8590d6473967da5685f29470e4c511d59281c1fe56b36142d2914441614455ccb7c1d1f17a
data/README.md CHANGED
@@ -68,6 +68,15 @@ calling parents with selectors. Example usage:
68
68
 
69
69
  ###What's New
70
70
 
71
+ ####Version 0.0.9
72
+
73
+ JavaScript callback option now available. Whenever the Dynaspan field is submitted you can have Dynaspan call
74
+ your own JavaScript method.
75
+
76
+ {
77
+ callback_on_update: "someMethod('some-relative-instance-value');"
78
+ }
79
+
71
80
  ####Version 0.0.8
72
81
 
73
82
  You can now provide an option hash as a last parameter. Current
@@ -37,7 +37,8 @@ module Dynaspan
37
37
  attrib: attrib,
38
38
  unique_ref_id: dynaspan_counter,
39
39
  dyna_span_edit_text: edit_text,
40
- hidden_fields: options[:hidden_fields]
40
+ hidden_fields: options[:hidden_fields],
41
+ ds_callback_on_update: options[:callback_on_update]
41
42
  }
42
43
  )
43
44
  end
@@ -1,5 +1,5 @@
1
1
  <%# This is used through the helper method dynaspan_text_area %>
2
- <div id="dyna_span_block<%= unique_ref_id %>" class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
2
+ <div id="dyna_span_block<%= unique_ref_id %>" <%= "data-ds-callback-on-update=\"#{ds_callback_on_update}\" " if ds_callback_on_update.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
3
3
  <%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
4
4
  <div id="<%= "dyna_span_div#{unique_ref_id}" %>" style="display:none;">
5
5
  <%= form_for(master_ds_object, method: :patch, remote: true, authenticity_token: true) do |f| %>
@@ -1,5 +1,5 @@
1
1
  <%# This is used through the helper method dynaspan_text_field %>
2
- <div id="dyna_span_block<%= unique_ref_id %>" class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
2
+ <div id="dyna_span_block<%= unique_ref_id %>" <%= "data-ds-callback-on-update=\"#{ds_callback_on_update}\" " if ds_callback_on_update.present? %>class='dyna-span<%= ' ds-content-present' if (attr_object.try(attrib).present? || master_ds_object.try(attrib).present?) %>'>
3
3
  <%= hidden_field_tag "last_dyna_span_val_#{unique_ref_id}", attr_object.try(attrib) || master_ds_object.try(attrib), id: "last_dyna_span_val_#{unique_ref_id}" %>
4
4
  <div id="<%= "dyna_span_div#{unique_ref_id}" %>" style="display:none;">
5
5
  <%= form_for(master_ds_object, method: :patch, remote: true, authenticity_token: true) do |f| %>
@@ -1,3 +1,3 @@
1
1
  module Dynaspan
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
@@ -26,5 +26,8 @@
26
26
  } else {
27
27
  ds_block.addClass("ds-content-present")
28
28
  }
29
+ if (ds_block.data('dsCallbackOnUpdate')){
30
+ eval(ds_block.data('dsCallbackOnUpdate'))
31
+ }
29
32
  };
30
33
  })(jQuery);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynaspan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: In place text editing with AJAX substituting text to input field.
14
14
  email: