dynaspan 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49e0c7307a4aaa55cff2d0966fd46cc6dbfec210
|
4
|
+
data.tar.gz: 2e6049f9c65480051895b2c1171b6dac49edaa10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76f858cdc40b7d37b0540713005185d5b5639d09503b67f37ed7ad1991df2222a91620edfea95d5873260e40f6dc33296d9e42863d0791b5ed40aec88bed4362
|
7
|
+
data.tar.gz: 95c613583563e022d5e8f0bb6a6be14e79271b9e5f26d8365f610975800351d7541c0ffa323795d3744fc60f9eb736d42cab12e7b192d627f788f9742d32a84b
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Dynaspan also accepts updating an attribute for a nested object, but only 1 leve
|
|
6
6
|
|
7
7
|
###Installation
|
8
8
|
|
9
|
-
- [ ] Add `gem 'dynaspan'` to your Gemfile.
|
9
|
+
- [ ] Add `gem 'dynaspan', '~> 0.0.4'` to your Gemfile.
|
10
10
|
- [ ] Run `bundle`.
|
11
11
|
- [ ] Next add `include Dynaspan::ApplicationHelper` inside your **ApplicationHelper** module.
|
12
12
|
- [ ] Add `//= require dynaspan/dynaspan` to your **application.js** file.
|
@@ -5,10 +5,10 @@
|
|
5
5
|
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
|
6
6
|
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
|
7
7
|
<%= a.hidden_field :id, value: attr_object.id %>
|
8
|
-
<%= a.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
8
|
+
<%= a.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
9
9
|
<% end %>
|
10
10
|
<% else %>
|
11
|
-
<%= f.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
11
|
+
<%= f.text_area attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
@@ -5,10 +5,10 @@
|
|
5
5
|
<% if master_ds_object.nested_attributes_options.keys.any? {|i| i.to_s.=~(/#{attr_object.class.try(:model_name).try(:i18n_key).to_s}/) || i.to_s.=~(/#{attr_object.class.try(:table_name)}/) } and !attr_object.nil? %>
|
6
6
|
<%= f.fields_for master_ds_object.nested_attributes_options.keys.select {|i| i.to_s.=~(/#{attr_object.class.model_name.i18n_key.to_s}/) || i.to_s.=~(/#{attr_object.class.table_name}/) }.first, attr_object do |a|%>
|
7
7
|
<%= a.hidden_field :id, value: attr_object.id %>
|
8
|
-
<%= a.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
8
|
+
<%= a.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
9
9
|
<% end %>
|
10
10
|
<% else %>
|
11
|
-
<%= f.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
11
|
+
<%= f.text_field attrib, id: "dyna_span_field_val_#{unique_ref_id}", class: 'dyna-span form-control dyna-span-input', onfocus: "$().dynaspan.upLast('#{unique_ref_id}');", onblur: "$().dynaspan.upHide('#{unique_ref_id}');" %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
14
14
|
</div>
|
data/lib/dynaspan/version.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
// MIT LICENSE
|
2
|
+
// Copyright (c) 2014 Daniel P. Clark
|
3
|
+
(function($){
|
2
4
|
$.fn.dynaspan = function(){};
|
3
5
|
|
4
6
|
$.fn.dynaspan.upLast = function(uniq_id_ref){
|
@@ -6,8 +8,12 @@
|
|
6
8
|
};
|
7
9
|
|
8
10
|
$.fn.dynaspan.upShow = function(uniq_id_ref){
|
9
|
-
|
11
|
+
//setTimeout(
|
12
|
+
// function(){
|
13
|
+
$('#dyna_span_div' + uniq_id_ref).show().find('.dyna-span-input').focus();
|
10
14
|
$('#dyna_span_span' + uniq_id_ref).hide();
|
15
|
+
// }, 0
|
16
|
+
//);
|
11
17
|
};
|
12
18
|
|
13
19
|
$.fn.dynaspan.upHide = function(uniq_id_ref){
|
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.
|
4
|
+
version: 0.0.5
|
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-
|
11
|
+
date: 2014-12-09 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:
|