rsence-pre 3.0.0.12 → 3.0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/client/js/controls/textcontrol/textcontrol.coffee +3 -2
- data/client/js/core/class/class.js +12 -2
- data/client/js/core/elem/elem.coffee +2 -0
- data/client/js/datetime/timesheet/themes/default/timesheet.css +28 -37
- data/client/js/datetime/timesheet/themes/default/timesheet.html +3 -3
- data/client/js/datetime/timesheet/timesheet.coffee +610 -0
- data/client/js/datetime/timesheet_item/themes/default/timesheet_item.css +33 -35
- data/client/js/datetime/timesheet_item/themes/default/timesheet_item.html +6 -10
- data/client/js/datetime/timesheet_item/timesheet_item.coffee +144 -0
- data/client/js/foundation/control/eventresponder/eventresponder.js +3 -4
- data/client/js/foundation/eventmanager/eventmanager.coffee +6 -0
- data/client/js/tables/table/table.coffee +89 -37
- data/client/js/tables/table/themes/default/table.css +7 -7
- data/client/js/tables/table/themes/default/table.html +3 -3
- metadata +4 -4
- data/client/js/datetime/timesheet/timesheet.js +0 -852
- data/client/js/datetime/timesheet_item/timesheet_item.js +0 -210
@@ -1,72 +1,70 @@
|
|
1
|
-
.timesheet_item,
|
2
|
-
.
|
3
|
-
.
|
4
|
-
.
|
5
|
-
.
|
6
|
-
.
|
7
|
-
.
|
8
|
-
.
|
1
|
+
.default.timesheet_item,
|
2
|
+
.default.timesheet_item > .middle,
|
3
|
+
.default.timesheet_item > .middle > .label,
|
4
|
+
.default.timesheet_item > .resize_top,
|
5
|
+
.default.timesheet_item > .move,
|
6
|
+
.default.timesheet_item > .time,
|
7
|
+
.default.timesheet_item > .icons,
|
8
|
+
.default.timesheet_item > .resize_bottom {
|
9
9
|
position: absolute;
|
10
|
-
left:
|
10
|
+
left: 0; right: 0;
|
11
11
|
}
|
12
|
-
.timesheet_item {
|
13
|
-
top:
|
12
|
+
.default.timesheet_item {
|
13
|
+
top: 0; bottom: 0;
|
14
14
|
border: 1px solid #ccc;
|
15
15
|
border-radius: 7px;
|
16
16
|
opacity: 0.75;
|
17
17
|
}
|
18
|
-
.
|
19
|
-
.
|
18
|
+
.default.timesheet_item > .time,
|
19
|
+
.default.timesheet_item > .middle > .label {
|
20
20
|
font-size: 12px;
|
21
21
|
color: #333;
|
22
22
|
font-family: Helvetica, Arial, sans-serif;
|
23
23
|
}
|
24
|
-
.
|
25
|
-
top:
|
24
|
+
.default.timesheet_item > .time {
|
25
|
+
top: 0; height: 12px; line-height: 12px;
|
26
26
|
text-indent: 4px; padding-top: 2px;
|
27
27
|
font-weight: bold;
|
28
28
|
}
|
29
|
-
.active > .
|
29
|
+
.default.timesheet_item.active > .time {
|
30
30
|
border-radius: 7px 7px 0 0;
|
31
31
|
border-bottom: 1px solid #000;
|
32
|
-
/* opacity: 0.2;*/
|
33
32
|
}
|
34
|
-
.
|
33
|
+
.default.timesheet_item.active {
|
35
34
|
border-color: #000;
|
36
35
|
opacity: 1;
|
37
36
|
}
|
38
|
-
.
|
39
|
-
top: 50%; height:
|
37
|
+
.default.timesheet_item > .middle {
|
38
|
+
top: 50%; height: 0;
|
40
39
|
overflow: visible;
|
41
40
|
}
|
42
|
-
.
|
41
|
+
.default.timesheet_item > .middle > .label {
|
43
42
|
text-align: center;
|
44
43
|
opacity: 1;
|
45
44
|
top: -6px; height: 12px;
|
46
45
|
}
|
47
|
-
.
|
48
|
-
top:
|
46
|
+
.default.timesheet_item > .resize_top {
|
47
|
+
top: 0; height: 6px;
|
49
48
|
cursor: n-resize;
|
50
49
|
}
|
51
|
-
.
|
50
|
+
.default.timesheet_item > .move {
|
52
51
|
top: 6px; bottom: 6px;
|
53
52
|
cursor: move;
|
54
53
|
}
|
55
|
-
.
|
56
|
-
bottom:
|
54
|
+
.default.timesheet_item > .resize_bottom {
|
55
|
+
bottom: 0; height: 6px;
|
57
56
|
cursor: s-resize;
|
58
57
|
}
|
59
|
-
.
|
60
|
-
top:
|
58
|
+
.default.timesheet_item > .icons {
|
59
|
+
top: 0; height: 16px;
|
61
60
|
}
|
62
|
-
.
|
61
|
+
.default.timesheet_item > .icons > .icon {
|
63
62
|
position: absolute;
|
64
|
-
top:
|
65
|
-
background-position:
|
63
|
+
top: 0; width: 16px; height: 16px;
|
64
|
+
background-position: 0 0;
|
66
65
|
}
|
67
|
-
|
68
|
-
.locked .
|
69
|
-
.locked .
|
70
|
-
.locked .timesheet_item_resize_top {
|
66
|
+
.default.timesheet_item.locked > .move,
|
67
|
+
.default.timesheet_item.locked > .resize_bottom,
|
68
|
+
.default.timesheet_item.locked > .resize_top {
|
71
69
|
cursor: pointer;
|
72
70
|
}
|
@@ -1,10 +1,6 @@
|
|
1
|
-
<div class="
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
<div class="timesheet_item_resize_top"></div>
|
8
|
-
<div class="timesheet_item_resize_bottom"></div>
|
9
|
-
<div class="timesheet_item_move" id="subview]I["></div>
|
10
|
-
</div>
|
1
|
+
<div class="time" id="state]I["></div>
|
2
|
+
<div class="middle"><div class="label" id="label]I[">#{this.label}</div></div>
|
3
|
+
<div class="icons" id="icons]I["></div>
|
4
|
+
<div class="resize_top"></div>
|
5
|
+
<div class="resize_bottom"></div>
|
6
|
+
<div class="move" id="subview]I["></div>
|
@@ -0,0 +1,144 @@
|
|
1
|
+
|
2
|
+
###
|
3
|
+
## = Description
|
4
|
+
## Item class to be used with HTimeSheet.
|
5
|
+
###
|
6
|
+
HTimeSheetItem = HControl.extend
|
7
|
+
componentName: 'timesheet_item'
|
8
|
+
markupElemNames: ['label', 'state', 'icons', 'value', 'subview']
|
9
|
+
controlDefaults: HControlDefaults.extend
|
10
|
+
displayTime: true
|
11
|
+
iconImage: 'timesheet_item_icons.png'
|
12
|
+
drawIcon: ( _iconOrder, _iconId )->
|
13
|
+
_iconElemId = ELEM.make( @markupElemIds.icons, 'div' )
|
14
|
+
_iconUrl = @getThemeGfxFile( @options.iconImage )
|
15
|
+
ELEM.addClassName( _iconElemId, 'icon' )
|
16
|
+
ELEM.setStyles( _iconElemId,
|
17
|
+
right: (_iconOrder*16+_iconOrder)+'px'
|
18
|
+
backgroundPosition: '0px '+(_iconId*-16)+'px'
|
19
|
+
backgroundImage: 'url('+_iconUrl+')'
|
20
|
+
)
|
21
|
+
_iconElemId
|
22
|
+
clearAllIcons: ->
|
23
|
+
if @typeChr(@icons) == 'a'
|
24
|
+
for _iconId in @icons
|
25
|
+
ELEM.del( _iconId )
|
26
|
+
@icons = []
|
27
|
+
die: ->
|
28
|
+
@clearAllIcons()
|
29
|
+
@icons = null
|
30
|
+
@base()
|
31
|
+
refreshState: (_start, _duration)->
|
32
|
+
return unless @options.displayTime
|
33
|
+
_startTime = _start or @value.start
|
34
|
+
_endTime = _startTime + ( _duration or @value.duration )
|
35
|
+
_locale = HLocale.dateTime
|
36
|
+
_stateText = _locale.formatTime( _startTime ) + _locale.strings.rangeDelimitter + _locale.formatTime( _endTime )
|
37
|
+
ELEM.setHTML( @markupElemIds.state, _stateText )
|
38
|
+
refreshValue: ->
|
39
|
+
return unless @typeChr(@value) == 'h'
|
40
|
+
@drawRect()
|
41
|
+
if @value.color
|
42
|
+
@setStyle( 'backgroundColor', @value.color )
|
43
|
+
else
|
44
|
+
@setStyle( 'backgroundColor', '#999' )
|
45
|
+
@setLabel( @value.label ) if @value.label
|
46
|
+
if @value.locked
|
47
|
+
ELEM.addClassName( @elemId, 'locked' )
|
48
|
+
else
|
49
|
+
ELEM.delClassName( @elemId, 'locked' )
|
50
|
+
@refreshState()
|
51
|
+
@clearAllIcons()
|
52
|
+
if @typeChr( @value.icons ) == 'a'
|
53
|
+
for _icon, i in @value.icons
|
54
|
+
@icons.push( @drawIcon( i, _icon ) );
|
55
|
+
click: ->
|
56
|
+
@bringToFront()
|
57
|
+
doubleClick: ( x, y )->
|
58
|
+
@bringToFront()
|
59
|
+
@parent.activateEditor( this )
|
60
|
+
|
61
|
+
dragMode: 0 # none
|
62
|
+
_isValueValidForDrag: -> @typeChr(@value) == 'h' and not @value.locked
|
63
|
+
startDrag: (x, y)->
|
64
|
+
@bringToFront()
|
65
|
+
if @_isValueValidForDrag()
|
66
|
+
_topY = y-@pageY()
|
67
|
+
_bottomY = @rect.height - _topY
|
68
|
+
_resizeTop = ( _topY >= 0 && _topY <= 6 )
|
69
|
+
_resizeBottom = ( _bottomY >= 0 && _bottomY <= 6 )
|
70
|
+
_move = ( _topY > 6 && _bottomY > 6 )
|
71
|
+
if _resizeTop
|
72
|
+
@dragMode = 2 # resize-top
|
73
|
+
else if _resizeBottom
|
74
|
+
@dragMode = 3 # resize-bottom
|
75
|
+
else if _move
|
76
|
+
@dragMode = 1 # move
|
77
|
+
else
|
78
|
+
@dragMode = 0 # none
|
79
|
+
if @dragMode == 0
|
80
|
+
@originY = false
|
81
|
+
else
|
82
|
+
_originY = y-@parent.pageY()
|
83
|
+
_parentY = @parent.pageY()
|
84
|
+
_originTimeStart = @value.start
|
85
|
+
_originTimeEnd = _originTimeStart + @value.duration
|
86
|
+
@originY = _originY
|
87
|
+
@originTopPx = @rect.top
|
88
|
+
@originBottomPx = @rect.bottom
|
89
|
+
@originTimeStart = _originTimeStart
|
90
|
+
@originTimeEnd = _originTimeEnd
|
91
|
+
@originDuration = _originTimeEnd - _originTimeStart
|
92
|
+
@dragTimeStart = _originTimeStart
|
93
|
+
@dragDuration = @originDuration
|
94
|
+
drag: ( x, y )->
|
95
|
+
if @_isValueValidForDrag() and @dragMode != 0
|
96
|
+
y -= @parent.pageY()
|
97
|
+
_movePx = y - @originY
|
98
|
+
_topPx = @parent.snapPx( @originTopPx + _movePx )
|
99
|
+
_parentY = @parent.pageY()
|
100
|
+
if @dragMode == 1 # move
|
101
|
+
_maxTopPx = @parent.timeToPx( @parent.options.timeEnd ) - @rect.height
|
102
|
+
_topPx = _maxTopPx if _topPx > _maxTopPx
|
103
|
+
_timeStart = @parent.pxToTime(_topPx)
|
104
|
+
_duration = @originDuration
|
105
|
+
@rect.offsetTo( @rect.left, _topPx )
|
106
|
+
@drawRect()
|
107
|
+
@dragTimeStart = _timeStart
|
108
|
+
@dragDuration = _duration
|
109
|
+
else if @dragMode == 2 # resize-top
|
110
|
+
_maxTopPx = @parent.timeToPx( @originTimeEnd - @parent.minDuration )
|
111
|
+
_topPx = _maxTopPx if _topPx > _maxTopPx
|
112
|
+
_timeStart = @parent.pxToTime(_topPx)
|
113
|
+
_timeEnd = @originTimeEnd
|
114
|
+
if @rect.bottom - _topPx < @parent.options.itemMinHeight
|
115
|
+
_topPx = @rect.bottom - @parent.options.itemMinHeight
|
116
|
+
@rect.setTop( _topPx )
|
117
|
+
@drawRect()
|
118
|
+
@dragTimeStart = _timeStart
|
119
|
+
@dragDuration = _timeEnd - _timeStart
|
120
|
+
else if @dragMode == 3 # resize-top
|
121
|
+
_minBottomPx = @parent.timeToPx( @originTimeStart + @parent.minDuration )
|
122
|
+
_bottomPx = @parent.snapPx( @originBottomPx + _movePx )
|
123
|
+
_bottomPx = _minBottomPx if _bottomPx < _minBottomPx
|
124
|
+
_timeStart = @originTimeStart
|
125
|
+
_timeEnd = @parent.pxToTime(_bottomPx)
|
126
|
+
if _bottomPx - @rect.top < @parent.options.itemMinHeight
|
127
|
+
_bottomPx = @rect.top + @parent.options.itemMinHeight
|
128
|
+
@rect.setBottom( _bottomPx )
|
129
|
+
@drawRect()
|
130
|
+
@dragTimeStart = _timeStart
|
131
|
+
@dragDuration = _timeEnd - _timeStart
|
132
|
+
@refreshState( @dragTimeStart, @dragDuration )
|
133
|
+
endDrag: (x, y)->
|
134
|
+
if @_isValueValidForDrag() and @dragMode != 0
|
135
|
+
_startChanged = @dragTimeStart != @originTimeStart and @dragTimeStart != @value.start
|
136
|
+
_durationChanged = @dragDuration != @originDuration and @dragDuration != @value.duration
|
137
|
+
if _startChanged or _durationChanged
|
138
|
+
if @parent.editor
|
139
|
+
@parent.editor.modifyItem(
|
140
|
+
id: @value.id
|
141
|
+
start: @dragTimeStart
|
142
|
+
duration: @dragDuration
|
143
|
+
label: @value.label
|
144
|
+
)
|
@@ -172,7 +172,6 @@ HEventResponder = HClass.extend({
|
|
172
172
|
*
|
173
173
|
**/
|
174
174
|
setEnabled: function(_flag) {
|
175
|
-
|
176
175
|
var
|
177
176
|
_this = this,
|
178
177
|
_elemId = this.elemId,
|
@@ -180,12 +179,12 @@ HEventResponder = HClass.extend({
|
|
180
179
|
i = 0,
|
181
180
|
_views = _this.views,
|
182
181
|
_view,
|
183
|
-
_viewsLen = _views.length;
|
182
|
+
_viewsLen = _views?_views.length:0;
|
184
183
|
|
185
184
|
// Enable/disable the children first.
|
186
185
|
for (; i < _viewsLen; i++) {
|
187
186
|
_view = _sysViews[_views[i]];
|
188
|
-
_view
|
187
|
+
_view.setEnabled && _view.setEnabled(_flag);
|
189
188
|
}
|
190
189
|
|
191
190
|
if (_this.enabled === _flag) {
|
@@ -195,7 +194,7 @@ HEventResponder = HClass.extend({
|
|
195
194
|
|
196
195
|
_this.enabled = _flag;
|
197
196
|
|
198
|
-
if(_flag) {
|
197
|
+
if(_flag && _this.events) {
|
199
198
|
EVENT.reg(_this, _this.events);
|
200
199
|
}
|
201
200
|
else {
|
@@ -417,6 +417,12 @@ EventManagerApp = HApplication.extend
|
|
417
417
|
if ~_viewIdx
|
418
418
|
@_listeners[_statusItem].splice(_viewIdx,1)
|
419
419
|
#
|
420
|
+
# Cancels the drag operation for the ctrl
|
421
|
+
cancelDrag: (_ctrl)->
|
422
|
+
_dragIdx = @_listeners.dragged.indexOf(_ctrl.viewId)
|
423
|
+
if ~_dragIdx
|
424
|
+
@_listeners.dragged.splice( _dragIdx, 1 )
|
425
|
+
#
|
420
426
|
# Registers the HControl -derived object _ctrl by event listener flags
|
421
427
|
# in _eventOptions.
|
422
428
|
reg: (_ctrl, _eventOptions)->
|
@@ -11,6 +11,7 @@ HTable = HControl.extend
|
|
11
11
|
cellBgColorDiff: '#080808' # color to add/subtract for even/odd col/row
|
12
12
|
cellBorderWidth: 1 # cell border width in pixels
|
13
13
|
cellBorderColor: '#fff' # cell border color
|
14
|
+
sortable: true # set to false, if table should not be sorted
|
14
15
|
customOptions: (_options)->
|
15
16
|
_options.headerCols = false unless _options.headerCols? # array of strings
|
16
17
|
_options.sortDescending = [] unless _options.sortDescending? # column sorting by index; true for descending; false for ascending
|
@@ -63,17 +64,23 @@ HTable = HControl.extend
|
|
63
64
|
_cellBgColorOf: (_row, _col)->
|
64
65
|
_colorIndex = (_row%2) + (1-_col%2)
|
65
66
|
@_cellBgColors[_colorIndex]
|
66
|
-
|
67
|
-
|
68
|
-
for _bgCellId in
|
67
|
+
_destroyBgCells: ->
|
68
|
+
for _row in @_bgCells
|
69
|
+
for _bgCellId in _row
|
69
70
|
ELEM.del( _bgCellId )
|
70
|
-
|
71
|
+
delete @_bgCells
|
72
|
+
die: ->
|
73
|
+
@_destroyBgCells() if @_bgCells?
|
74
|
+
@_destroyHeader()
|
75
|
+
@base()
|
76
|
+
_drawCellStyles: (_1stIdx, _addCount)->
|
77
|
+
@_destroyBgCells() if @_bgCells? and not _1stIdx?
|
71
78
|
return unless @colViews?
|
72
|
-
|
73
|
-
@_bgCells = []
|
79
|
+
return unless @_rowsDrawn
|
80
|
+
@_bgCells = [] unless _1stIdx?
|
74
81
|
_parent = @markupElemIds.grid
|
75
82
|
_leftOffset = @headerSizes[0][0]
|
76
|
-
@_initCellBgColors()
|
83
|
+
@_initCellBgColors() unless _1stIdx?
|
77
84
|
_borderSize = @options.cellBorderWidth
|
78
85
|
_borderColor = @options.cellBorderColor
|
79
86
|
_borderStyle = _borderSize+'px solid '+_borderColor
|
@@ -96,17 +103,20 @@ HTable = HControl.extend
|
|
96
103
|
_width += _halfBorderWidth
|
97
104
|
_top = _borderLeftOffset
|
98
105
|
for _row, _rowNum in @_rows
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
unless _1stIdx? and _rowNum < _1stIdx
|
107
|
+
@_bgCells[_rowNum] = [] unless @_bgCells[_rowNum]?
|
108
|
+
@_bgCells[_rowNum][_colNum] = ELEM.make(
|
109
|
+
_parent, 'div',
|
110
|
+
styles:
|
111
|
+
backgroundColor: @_cellBgColorOf(_rowNum,_colNum)
|
112
|
+
border: _borderStyle
|
113
|
+
top: _top+'px'
|
114
|
+
left: _left+'px'
|
115
|
+
width: _width+'px'
|
116
|
+
height: _height+'px'
|
117
|
+
)
|
109
118
|
_top += _topAdd
|
119
|
+
ELEM.flush()
|
110
120
|
drawHeader: ->
|
111
121
|
_elemIds = []
|
112
122
|
_sizes = []
|
@@ -125,7 +135,7 @@ HTable = HControl.extend
|
|
125
135
|
for _headerCol, i in @options.headerCols
|
126
136
|
_elemId = ELEM.make( @markupElemIds.header, 'div' )
|
127
137
|
@options.sortDescending[i] = false unless @options.sortDescending[i]?
|
128
|
-
ELEM.addClassName(_elemId,'
|
138
|
+
ELEM.addClassName(_elemId,'column')
|
129
139
|
_width = 0
|
130
140
|
if @options.colWidths[i]?
|
131
141
|
if @options.colWidths[i] == 'auto'
|
@@ -137,7 +147,7 @@ HTable = HControl.extend
|
|
137
147
|
_sizes.push([_left,_width])
|
138
148
|
ELEM.setAttr(_elemId,'sortcol',i)
|
139
149
|
ELEM.setHTML(_elemId,_headerCol)
|
140
|
-
if @options.sortCol == i
|
150
|
+
if @options.sortCol == i and @options.sortable
|
141
151
|
_sortColElem = ELEM.make( _elemId, 'div' )
|
142
152
|
if @options.headerStyles? and @options.headerStyles[i]?
|
143
153
|
_sortColClassName( @options.headerStyles[i] )
|
@@ -154,7 +164,10 @@ HTable = HControl.extend
|
|
154
164
|
e.preventDefault()
|
155
165
|
true
|
156
166
|
)
|
157
|
-
|
167
|
+
if @options.sortable
|
168
|
+
Event.observe(_elemId,'click',_sortFns[i])
|
169
|
+
else
|
170
|
+
ELEM.setStyle(_elemId,'cursor','default')
|
158
171
|
_left += _width
|
159
172
|
_elemIds.push( _elemId )
|
160
173
|
if _autoWidths.length > 0
|
@@ -179,9 +192,10 @@ HTable = HControl.extend
|
|
179
192
|
@headerSizes = _sizes
|
180
193
|
@_sortColElem = _sortColElem
|
181
194
|
@sortFns = _sortFns
|
195
|
+
ELEM.flush()
|
182
196
|
resize: ->
|
183
197
|
@drawHeader()
|
184
|
-
for _colNum in [0
|
198
|
+
for _colNum in [0...@headerCols.length]
|
185
199
|
_left = @headerSizes[_colNum][0] + 1
|
186
200
|
_width = @headerSizes[_colNum][1]
|
187
201
|
@colViews[_colNum].rect.offsetTo( _left, 0 )
|
@@ -287,24 +301,58 @@ HTable = HControl.extend
|
|
287
301
|
_colViews[_colNum] = HView.nu( [ _left, 0, _width, 1 ], @ )
|
288
302
|
@colViews = _colViews
|
289
303
|
if @_rowsDrawn and not _newData
|
290
|
-
@sortTableRows()
|
304
|
+
@sortTableRows() if @options.sortable
|
291
305
|
else if @_rowsDrawn and _newData and @_rows.length == @value.length
|
292
|
-
|
306
|
+
@refreshTableValues()
|
307
|
+
else if @_rowsDrawn and _newData and @_rows.length > @value.length
|
308
|
+
_1stIdx = @value.length
|
309
|
+
_lastIdx = @_rows.length-1
|
310
|
+
_delCount = _lastIdx-_1stIdx+1
|
311
|
+
for _rowNum in [_1stIdx.._lastIdx] by 1
|
312
|
+
_row = @_rows[_rowNum]
|
293
313
|
for _col, _colNum in _row
|
294
314
|
_ctrl = @_rows[_rowNum][_colNum]
|
295
|
-
_ctrl.
|
296
|
-
@
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
315
|
+
_ctrl.die()
|
316
|
+
@_rows.splice(_1stIdx,_delCount)
|
317
|
+
if @_bgCells?
|
318
|
+
for _row, _rowNum in @_bgCells
|
319
|
+
if _rowNum >= _1stIdx
|
320
|
+
for _bgCellId in _row
|
321
|
+
ELEM.del( _bgCellId )
|
322
|
+
@_bgCells.splice(_1stIdx,_delCount)
|
323
|
+
_top = 24 * _1stIdx
|
324
|
+
for _colView in @colViews
|
325
|
+
_colView.rect.setHeight(_top)
|
326
|
+
_colView.drawRect()
|
327
|
+
@refreshTableValues()
|
328
|
+
else if @_rowsDrawn and _newData and @_rows.length < @value.length
|
329
|
+
_1stIdx = @_rows.length
|
330
|
+
_lastIdx = @value.length-1
|
331
|
+
_addCount = _lastIdx - _1stIdx + 1
|
332
|
+
@refreshTableValues(_1stIdx)
|
333
|
+
@createTableRows(_1stIdx,_addCount)
|
334
|
+
else @createTableRows()
|
335
|
+
refreshTableValues: (_lastIdx)->
|
336
|
+
for _row, _rowNum in @value
|
337
|
+
break if _lastIdx? and _rowNum >= _lastIdx
|
338
|
+
for _col, _colNum in _row
|
339
|
+
_ctrl = @_rows[_rowNum][_colNum]
|
340
|
+
_ctrl.setValue( _col ) unless _ctrl.value == _col
|
341
|
+
@sortTableRows() if not _lastRow? and @options.sortable
|
342
|
+
createTableRows: (_1stIdx,_addCount)->
|
343
|
+
@_destroyRows() if @_rowsDrawn and not _1stIdx?
|
303
344
|
_rowHeight = 24
|
304
|
-
|
305
|
-
|
345
|
+
if _1stIdx?
|
346
|
+
_top = _1stIdx * _rowHeight
|
347
|
+
_rows = @_rows
|
348
|
+
_viewDefs = []
|
349
|
+
else
|
350
|
+
_top = 0
|
351
|
+
_rows = []
|
352
|
+
_viewDefs = []
|
306
353
|
_colViews = @colViews
|
307
354
|
for _row, _rowNum in @value
|
355
|
+
continue if _1stIdx? and _rowNum < _1stIdx
|
308
356
|
_rows[_rowNum] = []
|
309
357
|
for _col, _colNum in _row
|
310
358
|
[ _colClass, _colOpts ] = @_getClassNameAndValueOfCol(_col, _colNum)
|
@@ -317,12 +365,16 @@ HTable = HControl.extend
|
|
317
365
|
for _colView in _colViews
|
318
366
|
_colView.rect.setHeight(_top)
|
319
367
|
_colView.drawRect()
|
368
|
+
@_drawCellStyles(_1stIdx,_addCount) if _1stIdx? and @options.useCellGrid
|
320
369
|
_finishDraw = =>
|
321
370
|
@_rows = _rows
|
322
371
|
@_rowsDrawn = true
|
323
|
-
@sortTableRows()
|
324
|
-
|
325
|
-
|
372
|
+
@sortTableRows() if @options.sortable
|
373
|
+
unless _1stIdx?
|
374
|
+
if @options.useCellGrid
|
375
|
+
@pushTask => @_drawCellStyles()
|
376
|
+
if @drawTableExtras?
|
377
|
+
@pushTask => @drawTableExtras()
|
326
378
|
if _viewDefs.length > 0
|
327
379
|
@pushTask =>
|
328
380
|
_viewsToDraw = []
|
@@ -342,9 +394,9 @@ HTable = HControl.extend
|
|
342
394
|
_viewsToDraw.push(_view)
|
343
395
|
@pushTask =>
|
344
396
|
_colView.draw() for _colView in _viewsToDraw
|
397
|
+
ELEM.flush()
|
345
398
|
@pushTask( _finishDraw )
|
346
399
|
_progress.die()
|
347
|
-
# console.log('table render took:',@msNow()-_start,'ms') if !@isProduction
|
348
400
|
else _finishDraw()
|
349
401
|
refreshTableCols: (_newData)->
|
350
402
|
console.warn('HTable#refreshTableCols is not implemented yet!')
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.default > .
|
1
|
+
.default.table > .header {
|
2
2
|
position:absolute;
|
3
3
|
left: 0; top: 0; right: 0; height: 22px;
|
4
4
|
border: 1px solid #333;
|
@@ -11,25 +11,25 @@
|
|
11
11
|
-moz-user-select: none;
|
12
12
|
-khtml-user-select: none;
|
13
13
|
}
|
14
|
-
.default > .
|
14
|
+
.default.table > .header > .column {
|
15
15
|
top: 1px; height: 20px; position: absolute;
|
16
16
|
cursor: pointer; border-right: 1px solid #ccc;
|
17
17
|
font-weight: bold;
|
18
18
|
text-indent: 6px;
|
19
19
|
}
|
20
|
-
.default > .
|
20
|
+
.default.table > .header > .column > .sort {
|
21
21
|
position: absolute; top: 1px; right: 2px;
|
22
22
|
}
|
23
|
-
.default > .
|
23
|
+
.default.table > .header > .column > .sort_left {
|
24
24
|
position: absolute; top: 1px; left: 2px;
|
25
25
|
}
|
26
|
-
.default > .
|
26
|
+
.default.table > .body {
|
27
27
|
position: absolute; top: 24px; left: 0; right: 0; bottom: 0;
|
28
28
|
overflow: auto; overflow-x: hidden;
|
29
29
|
}
|
30
|
-
.default > .
|
30
|
+
.default.table > .body > .grid {
|
31
31
|
position: absolute; top: 0; left: 0; overflow: visible;
|
32
32
|
}
|
33
|
-
.default > .
|
33
|
+
.default.table > .body > .grid > div {
|
34
34
|
position: absolute; height: 24px;
|
35
35
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="header]I[" class="
|
2
|
-
<div id="subview]I[" class="
|
3
|
-
<div id="grid]I[" class="
|
1
|
+
<div id="header]I[" class="header"></div>
|
2
|
+
<div id="subview]I[" class="body">
|
3
|
+
<div id="grid]I[" class="grid"></div>
|
4
4
|
</div>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsence-pre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Riassence Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-07-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rsence-deps
|
@@ -236,11 +236,11 @@ files:
|
|
236
236
|
- client/js/datetime/timepicker/timepicker.coffee
|
237
237
|
- client/js/datetime/timesheet/themes/default/timesheet.css
|
238
238
|
- client/js/datetime/timesheet/themes/default/timesheet.html
|
239
|
-
- client/js/datetime/timesheet/timesheet.
|
239
|
+
- client/js/datetime/timesheet/timesheet.coffee
|
240
240
|
- client/js/datetime/timesheet_item/themes/default/timesheet_item.css
|
241
241
|
- client/js/datetime/timesheet_item/themes/default/timesheet_item.html
|
242
242
|
- client/js/datetime/timesheet_item/themes/default/timesheet_item_icons.png
|
243
|
-
- client/js/datetime/timesheet_item/timesheet_item.
|
243
|
+
- client/js/datetime/timesheet_item/timesheet_item.coffee
|
244
244
|
- client/js/datetime/timesheet_item_edit/timesheet_item_edit.js
|
245
245
|
- client/js/foundation/application/application.js
|
246
246
|
- client/js/foundation/control/control.js
|