lalala 4.0.0.dev.283 → 4.0.0.dev.284

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: e83d3f8b88728d4baa64cc7d9c70d68a3a0867b3
4
- data.tar.gz: 3fcf1e8d11995075bf9f38aefb9eef18210077ef
3
+ metadata.gz: b4f3a5d1a4796cad776c0233c5c5240527d95ac7
4
+ data.tar.gz: ad34a1c15ca8c26c85a0a0ad96c72ae1db453970
5
5
  SHA512:
6
- metadata.gz: f82cde937f2c63cc8cad79747b5e24e6d0d7a5a409bdadf3a14a9a4e4544118c445f0ce4fd41d0563d23d6fa357e9d28a99341ace1b937bb30ac130311715184
7
- data.tar.gz: b61f9004a170e2d7c2601da010d2b2f4808b7940c2b7e35883da5507c40959f6b1d6c7503fae1be8e271242337cdf7fe5037c07b3ecb2dc66f59eb9315857590
6
+ metadata.gz: a32301a9e9d57a7ffbd007b95c08040992cfc93bb2d7db481e4a13a7890bb2981ab45cbf3bf4bbe3a2d503f26ea755af3e81f248095ff35d669c953b4ea5217f
7
+ data.tar.gz: ce098aeaa7a34e49ba5e49d3cc3af51b2dbba649833fe57f9521eaf1f57a5a055e4d285314db540270d88f696e78a3feb5fcc4a22cf2795d9865a0a302c3cf93
@@ -8,8 +8,8 @@ var lalalaStorage = require('lalala/modules/storage'),
8
8
  /**
9
9
  * @constructor
10
10
  */
11
- function CPT() {
12
- this.$element = $('#index_tree_table_pages');
11
+ function CPT($element) {
12
+ this.$element = $element;
13
13
  this.$tree_parents = this.getTreeParents();
14
14
  this.states = lalalaStorage[storage_key] || [];
15
15
 
@@ -88,6 +88,11 @@ CPT.prototype.initStates = function() {
88
88
  * @param {jQuery object} $trigger The trigger element
89
89
  */
90
90
  CPT.prototype.close = function($target, $trigger) {
91
+ if ( !$target ) {
92
+ console.warn('Can not find tree target');
93
+ return;
94
+ }
95
+
91
96
  $target.hide();
92
97
  $trigger.addClass('closed');
93
98
 
@@ -102,6 +107,11 @@ CPT.prototype.close = function($target, $trigger) {
102
107
  * @param {jQuery object} $trigger The trigger element
103
108
  */
104
109
  CPT.prototype.open = function($target, $trigger) {
110
+ if ( !$target ) {
111
+ console.warn('Can not find tree target');
112
+ return;
113
+ }
114
+
105
115
  $target.show();
106
116
  $trigger.removeClass('closed');
107
117
 
@@ -155,5 +165,17 @@ CPT.prototype.saveState = function() {
155
165
  * Initialize module
156
166
  */
157
167
  exports.init = function() {
158
- new CPT();
168
+ var $collapsible_page_trees = $('#index_tree_table_pages');
169
+
170
+ if ( $collapsible_page_trees.length < 1 ) {
171
+ return;
172
+ }
173
+
174
+ $collapsible_page_trees.each( function() {
175
+ var $this = $(this);
176
+
177
+ if ( !$this.data('collapsible_pages_tree_instance') ) {
178
+ $this.data( 'collapsible_pages_tree_instance', new CPT($this) );
179
+ }
180
+ });
159
181
  };
@@ -1,6 +1,6 @@
1
1
  module Lalala
2
2
  VERSION = "4.0.0"
3
- BUILD = "283"
3
+ BUILD = "284"
4
4
 
5
5
  if BUILD != ("{{BUILD_NUMBER" + "}}") # prevent sed replacement (see script/ci)
6
6
  BUILD_VERSION = "#{VERSION}.dev.#{BUILD}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lalala
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.dev.283
4
+ version: 4.0.0.dev.284
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Menke
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2014-02-21 00:00:00.000000000 Z
16
+ date: 2014-02-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activeadmin