circle_speech_balloon 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,16 +38,25 @@ $ ->
38
38
  bln.attr('src', fn)
39
39
  balloon_trace = '#panel' + $(bln).attr('panel_id') + 'speech_balloon' + $(bln).attr('element_id') + 'balloon' + $(bln).attr('element_part_id')
40
40
  $(balloon_trace + 'system_picture_id').val(sp_id)
41
+ myform = (input) ->
42
+ div_trace = '#panel' + $(input).attr('panel_id') + 'speech_balloon' + $(input).attr('element_id') + 'balloon' + $(input).attr('element_part_id')
43
+ classname = $(div_trace + 'form').attr('classname')
44
+ if classname == 'CircleSpeechBalloon'
45
+ r = true
46
+ else
47
+ r = false
48
+ r
41
49
 
42
50
  $('input').map ->
43
51
  if $(@).attr('element_type') and $(@).attr('element_type') == 'speech_balloon' and $(@).attr('column') == 'r'
44
- $(@).spinner {
45
- spin: ( event, ui ) ->
46
- balloon_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'balloon' + $(@).attr('element_part_id')
47
- r_step = balloon_r_step()
48
- idx = balloon_index($(balloon_trace + 'r'), r_step)
49
- refresh_balloon($(balloon_trace), idx)
50
- }
52
+ if myform($(@))
53
+ $(@).spinner {
54
+ spin: ( event, ui ) ->
55
+ balloon_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'balloon' + $(@).attr('element_part_id')
56
+ r_step = balloon_r_step()
57
+ idx = balloon_index($(balloon_trace + 'r'), r_step)
58
+ refresh_balloon($(balloon_trace), idx)
59
+ }
51
60
 
52
61
 
53
62
  $('.r-down').map ->
@@ -74,10 +83,11 @@ $ ->
74
83
  # sync view
75
84
  $('input').map ->
76
85
  if $(@).attr('element_type') and $(@).attr('element_type') == 'speech_balloon'
77
- $(@).focusout ->
78
- switch $(@).attr('column')
79
- when 'r'
80
- balloon_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'balloon' + $(@).attr('element_part_id')
81
- r_step = balloon_r_step()
82
- idx = balloon_index($(balloon_trace + 'r'), r_step)
83
- refresh_balloon($(balloon_trace), idx)
86
+ if myform($(@))
87
+ $(@).focusout ->
88
+ switch $(@).attr('column')
89
+ when 'r'
90
+ balloon_trace = '#panel' + $(@).attr('panel_id') + 'speech_balloon' + $(@).attr('element_id') + 'balloon' + $(@).attr('element_part_id')
91
+ r_step = balloon_r_step()
92
+ idx = balloon_index($(balloon_trace + 'r'), r_step)
93
+ refresh_balloon($(balloon_trace), idx)
@@ -1,3 +1,4 @@
1
+ <div id="<%= balloon.field_tag_id(:form) %>" classname="<%= balloon.classname %>">
1
2
 
2
3
  <div class="field">
3
4
  <%= f.label :x %><br />
@@ -35,3 +36,4 @@
35
36
  <% unless balloon.new_record? %>
36
37
  <%= f.hidden_field :id, :id => balloon.field_tag_id(:id), :panel_id => balloon.tag_panel_id, :element_id => balloon.tag_element_id, :element_type => balloon.tag_element_type, :element_part_id => balloon.tag_element_part_id, :element_part_type => balloon.tag_element_part_type, :column => :id, :tree => balloon.field_tree(:id) %>
37
38
  <% end %>
39
+ </div>
@@ -1,3 +1,3 @@
1
1
  module CircleSpeechBalloon
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -69,6 +69,10 @@ module CircleSpeechBalloon
69
69
  @r_step ||= self.parsed_settings['speech_balloon']['r_step']
70
70
  end
71
71
 
72
+ def classname
73
+ get_speech_balloon.speech_balloon_template.classname
74
+ end
75
+
72
76
  end
73
77
 
74
78
  module SpeechModule
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circle_speech_balloon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-07 00:00:00.000000000 Z
12
+ date: 2013-07-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails