jquery_sortable_tree 3.1.0 → 3.1.1

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: 176af5700482ebd2c556ebbaebd76c840561735e
4
- data.tar.gz: c510f8471e7283d03bb3dd5dead8385df941a4eb
3
+ metadata.gz: 6fae97d1cfe28cf48b9452f4616454fd5667b2f4
4
+ data.tar.gz: 6a571ea0ae0282b21659f19fcefeeff6e8ca7bc1
5
5
  SHA512:
6
- metadata.gz: b9b0fa92c763b3827e23ff075a36618899d72f198f2fd33c537dacad3aee385c914233ed1bd4c072a691deee894fd866dbbabfdc1268ca54a6a9cd5b077e4c2d
7
- data.tar.gz: 94768b423e5e75c85595762b0bfc5c25de6e274f6a1c16dfb2d4b9fcee8adbc9597ea532c66052110f159c967e7463857f1657a5663b269e71ca55e7db69bd7b
6
+ metadata.gz: 9bdc12b9aec2e283c0e66c8f3e8eb9554ede8fcc8881c37e497be0502f09b163d162bd634a5d3738fd9262cb6b845bf8afafa785f7b3c4dba51639ab483efa7c
7
+ data.tar.gz: b5835e1a754d3f874bac4b49f3a6b516cdf179627bd7cdb0793cd36776086f18702bf726c9ddd99df9ca429099c4ee34bf0f0d77ed996e198774b5d696827355
data/README.md CHANGED
@@ -80,6 +80,7 @@ or Extendable GUI:
80
80
 
81
81
  ```ruby
82
82
  //= require expandable_tree/initializer
83
+ ```
83
84
 
84
85
  #### Stylesheets
85
86
 
@@ -339,4 +340,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
339
340
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
340
341
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
341
342
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
342
- W
343
+ W
@@ -50,7 +50,7 @@ $ ->
50
50
  list_item.appendTo(sortable_tree)
51
51
 
52
52
  # remove items that deleted
53
- $('ol.sortable_tree').on 'ajax:success', '.controls a.delete', -> $(this).parent().parent().remove()
53
+ $('ol.sortable_tree').on 'ajax:success', '.controls a.delete', -> $(this).parent().parent().parent().remove()
54
54
 
55
55
  # edit clicked item
56
56
  $('ol.sortable_tree').on 'click', 'h4 > a.edit', @edit_node
@@ -54,16 +54,21 @@ module JquerySortableTreeHelper
54
54
  OpenStruct.new(options[:title] => '', id: ':id', children: nil)
55
55
  end
56
56
 
57
- def sortable_tree(tree, options = {})
58
- space(20) +
59
- add_new_node_form(base_data.merge(options)) +
60
- content_tag(:ol, build_tree_html(self, TREE_RENDERERS[:sortable], base_options.merge(options).merge({ node: fake_node(options) })), class: 'fake-node hidden', style: 'display: none;') +
61
- content_tag(:ol, build_server_tree(tree, { type: :sortable }.merge!(options)),
57
+ def fake_sortable_ol_tag(options)
58
+ content_tag(:ol, build_tree_html(self, TREE_RENDERERS[:sortable], base_options.merge(options).merge({ node: fake_node(options) })), class: 'fake-node hidden', style: 'display: none;')
59
+ end
60
+
61
+ def real_sortable_ol_tag(tree, options)
62
+ content_tag(:ol, build_server_tree(tree, { type: :sortable }.merge(options)),
62
63
  class: 'sortable_tree',
63
64
  data: base_data.merge(options.slice(:parent_id, :model, :rebuild_url, :title, :max_levels))
64
65
  )
65
66
  end
66
67
 
68
+ def sortable_tree(tree, options = {})
69
+ space(20) + add_new_node_form(base_data.merge(options)) + fake_sortable_ol_tag(options) + real_sortable_ol_tag(tree, options)
70
+ end
71
+
67
72
  def form_for_options(options)
68
73
  {
69
74
  html: { id: "new-#{options[:model]}-form" },
@@ -1,3 +1,3 @@
1
1
  module JquerySortableTree
2
- VERSION = '3.1.0'
2
+ VERSION = '3.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery_sortable_tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya N. Zykin
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-08-09 00:00:00.000000000 Z
14
+ date: 2014-08-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails