-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathSectionList.js
More file actions
72 lines (60 loc) · 1.26 KB
/
SectionList.js
File metadata and controls
72 lines (60 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
* Single Section View
*
* @since 3.13.0
* @version 3.16.0
*/
define( [ 'Views/Section', 'Views/_Receivable' ], function( SectionView, Receivable ) {
return Backbone.CollectionView.extend( _.defaults( {
/**
* Parent element
*
* @type {String}
*/
el: '#llms-sections',
events : {
'mousedown > li.llms-section' : '_listItem_onMousedown',
// 'dblclick > li, tbody > tr > td' : '_listItem_onDoubleClick',
'click' : '_listBackground_onClick',
'click ul.collection-view' : '_listBackground_onClick',
'keydown' : '_onKeydown'
},
/**
* Section model
*
* @type {[type]}
*/
modelView: SectionView,
/**
* Enable keyboard events
*
* @type {Bool}
*/
processKeyEvents: false,
/**
* Are sections selectable?
*
* @type {Bool}
*/
selectable: true,
/**
* Are sections sortable?
*
* @type {Bool}
*/
sortable: true,
sortableOptions: {
axis: false,
cursor: 'move',
handle: '.drag-section',
items: '.llms-section',
placeholder: 'llms-section llms-sortable-placeholder',
},
sortable_start: function( collection ) {
this.$el.addClass( 'dragging' );
},
sortable_stop: function( collection ) {
this.$el.removeClass( 'dragging' );
},
}, Receivable ) );
} );