lalala 4.0.0.dev.277 → 4.0.0.dev.279
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/lalala/modules/collapsible_pages_tree.module.js +15 -8
- data/app/assets/stylesheets/lalala/components/_tables.css.scss +1 -1
- data/app/assets/stylesheets/lalala/modules/_index-as-tree-table.css.scss +15 -8
- data/lib/lalala/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccc606f086137e14a5e08168385c0c38e5f7e4e5
|
4
|
+
data.tar.gz: 485447d2da4248fe3b99bd08bda7732ca1e364d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f9b6294bda402b07640de4b20604b37cd71ff03ad681463207de46fa4e2f277b6e261f490581513c5c1107d771f622394e7b41d98de5c91ecc4602ef9b7959f
|
7
|
+
data.tar.gz: d973cdb51d14480f5e606f851c79efd58abe377288ec88cfb997f80de9b0f2a2f8373d84732e487ef1b3bcc7576fd026b067ca4a0433cfcbd669bf939d0dc67d
|
@@ -16,7 +16,7 @@ function CPT() {
|
|
16
16
|
this.addTriggers();
|
17
17
|
this.initStates();
|
18
18
|
|
19
|
-
this.$tree_parents.on('click.collapsible_tree', '.
|
19
|
+
this.$tree_parents.on('click.collapsible_tree', '.collapsable', $.proxy(this.toggleState, this));
|
20
20
|
|
21
21
|
// Best behaviour would be to save on window unload,
|
22
22
|
// but the current storage save on unload is wrong,
|
@@ -26,14 +26,14 @@ function CPT() {
|
|
26
26
|
|
27
27
|
|
28
28
|
/**
|
29
|
-
* Get tree items with children
|
29
|
+
* Get tree items (<tr>'s) with children
|
30
30
|
*
|
31
31
|
* It adds the target as a data attribute to the tree parent element
|
32
32
|
*
|
33
33
|
* @return {jQuery Array}
|
34
34
|
*/
|
35
35
|
CPT.prototype.getTreeParents = function() {
|
36
|
-
return this.$element.find('td.subtree').map(function() {
|
36
|
+
return this.$element.find('td.subtree').closest('tr').map(function() {
|
37
37
|
var $subtree = $(this),
|
38
38
|
$tree_parent = $(this).closest('tr').prev();
|
39
39
|
|
@@ -48,12 +48,19 @@ CPT.prototype.getTreeParents = function() {
|
|
48
48
|
* Add trigger column to tree parent rows
|
49
49
|
*/
|
50
50
|
CPT.prototype.addTriggers = function() {
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
var $trigger = $('<td class="collapse"></td>');
|
52
|
+
|
53
|
+
// Add <td> to every <tr> to keep table structure in balance
|
54
|
+
this.$element.find('tr').prepend( $trigger );
|
55
|
+
|
56
|
+
// Activate triggers
|
57
|
+
this.$element.find('table.subtree').each(function() {
|
58
|
+
var $subtree = $(this),
|
59
|
+
$tree_parent = $subtree.closest('tr').prev();
|
54
60
|
|
55
|
-
$
|
56
|
-
|
61
|
+
$tree_parent.find('.collapse')
|
62
|
+
.addClass('collapsable')
|
63
|
+
.data('tree_parent', $tree_parent);
|
57
64
|
});
|
58
65
|
};
|
59
66
|
|
@@ -11,23 +11,30 @@
|
|
11
11
|
background-color: white;
|
12
12
|
|
13
13
|
&.collapse {
|
14
|
-
|
15
|
-
|
14
|
+
cursor: pointer;
|
15
|
+
padding: 0 0 0 5px;
|
16
|
+
width: 10px;
|
17
|
+
}
|
18
|
+
|
19
|
+
&.collapse.collapsable {
|
20
|
+
|
16
21
|
|
17
22
|
&:before {
|
18
23
|
border-color: black transparent transparent transparent;
|
19
24
|
border-style: solid;
|
20
|
-
border-width:
|
25
|
+
border-width: 4px;
|
21
26
|
content: "";
|
22
|
-
cursor: pointer;
|
23
27
|
display: block;
|
28
|
+
height: 0;
|
29
|
+
left: 2px;
|
24
30
|
position: relative;
|
25
|
-
top:
|
31
|
+
top: 3px;
|
32
|
+
width: 0;
|
26
33
|
}
|
27
34
|
|
28
35
|
}
|
29
36
|
|
30
|
-
&.collapse.closed {
|
37
|
+
&.collapse.collapsable.closed {
|
31
38
|
|
32
39
|
&:before {
|
33
40
|
border-color: transparent transparent transparent black;
|
@@ -38,12 +45,12 @@
|
|
38
45
|
}
|
39
46
|
|
40
47
|
&.selectable {
|
41
|
-
padding
|
48
|
+
padding: 0 5px;
|
42
49
|
width: 16px;
|
43
50
|
}
|
44
51
|
|
45
52
|
&.position {
|
46
|
-
padding
|
53
|
+
padding: 0;
|
47
54
|
width: 16px;
|
48
55
|
|
49
56
|
.drag-handle {
|
data/lib/lalala/version.rb
CHANGED