forked from tungstenfabric/tf-webui-third-party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjnpr_slickgrid.patch
168 lines (150 loc) · 6.84 KB
/
jnpr_slickgrid.patch
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
diff -Naur old/contrail-webui-third-party/jnpr_slickgrid/plugins/slick.checkboxselectcolumn.js new/contrail-webui-third-party/jnpr_slickgrid/plugins/slick.checkboxselectcolumn.js
--- old/contrail-webui-third-party/jnpr_slickgrid/plugins/slick.checkboxselectcolumn.js 2014-05-05 13:33:23.000000000 -0700
+++ new/contrail-webui-third-party/jnpr_slickgrid/plugins/slick.checkboxselectcolumn.js 2014-12-18 12:04:55.000000000 -0800
@@ -26,7 +26,7 @@
_handler
.subscribe(_grid.onSelectedRowsChanged, handleSelectedRowsChanged)
.subscribe(_grid.onClick, handleClick)
- .subscribe(_grid.onHeaderClick, handleHeaderClick)
+ // .subscribe(_grid.onHeaderClick, handleHeaderClick)
.subscribe(_grid.onKeyDown, handleKeyDown);
}
@@ -41,20 +41,21 @@
row = selectedRows[i];
lookup[row] = true;
if (lookup[row] !== _selectedRowsLookup[row]) {
- _grid.invalidateRow(row);
+ // _grid.invalidateRow(row);
delete _selectedRowsLookup[row];
}
}
- for (i in _selectedRowsLookup) {
- _grid.invalidateRow(i);
- }
+ //for (i in _selectedRowsLookup) {
+ // _grid.invalidateRow(i);
+ //}
+ _grid.invalidateAllRows();
_selectedRowsLookup = lookup;
- _grid.render();
+ //_grid.render();
- if (selectedRows.length && selectedRows.length == _grid.getDataLength()) {
- _grid.updateColumnHeader(_options.columnId, "<input type='checkbox' checked='checked'>", _options.toolTip);
+ if (selectedRows.length && selectedRows.length >= _grid.getDataLength()) {
+ _grid.updateColumnHeader(_options.columnId, "<input class='ace-input headerRowCheckbox' type='checkbox' checked='checked'> <span class='ace-lbl'></span>", _options.toolTip);
} else {
- _grid.updateColumnHeader(_options.columnId, "<input type='checkbox'>", _options.toolTip);
+ _grid.updateColumnHeader(_options.columnId, "<input class='ace-input headerRowCheckbox' type='checkbox'> <span class='ace-lbl'></span>", _options.toolTip);
}
}
@@ -80,7 +81,6 @@
e.stopImmediatePropagation();
return;
}
-
toggleRowSelection(args.row);
e.stopPropagation();
e.stopImmediatePropagation();
diff -Naur old/contrail-webui-third-party/jnpr_slickgrid/slick.dataview.js new/contrail-webui-third-party/jnpr_slickgrid/slick.dataview.js
--- old/contrail-webui-third-party/jnpr_slickgrid/slick.dataview.js 2014-05-05 13:33:23.000000000 -0700
+++ new/contrail-webui-third-party/jnpr_slickgrid/slick.dataview.js 2014-12-22 16:51:15.000000000 -0800
@@ -30,7 +30,7 @@
// private
- var idProperty = "id"; // property holding a unique row id
+ var idProperty = "cgrid"; // property holding a unique row id
var items = []; // data by index
var rows = []; // data by row
var idxById = {}; // indexes by id
@@ -76,6 +76,7 @@
var onRowCountChanged = new Slick.Event();
var onRowsChanged = new Slick.Event();
var onPagingInfoChanged = new Slick.Event();
+ var onDataUpdate = new Slick.Event();
options = $.extend(true, {}, defaults, options);
@@ -842,11 +843,13 @@
pagenum = Math.max(0, Math.ceil(totalRows / pagesize) - 1);
diff = recalc(items, filter);
}
-
+
updated = null;
prevRefreshHints = refreshHints;
refreshHints = {};
+ onDataUpdate.notify({previous: countBefore, current: rows.length,rows: diff});
+
if (totalRowsBefore != totalRows) {
onPagingInfoChanged.notify(getPagingInfo(), null, self);
}
@@ -856,6 +859,7 @@
if (diff.length > 0) {
onRowsChanged.notify({rows: diff}, null, self);
}
+
}
/***
@@ -1018,7 +1022,8 @@
// events
"onRowCountChanged": onRowCountChanged,
"onRowsChanged": onRowsChanged,
- "onPagingInfoChanged": onPagingInfoChanged
+ "onPagingInfoChanged": onPagingInfoChanged,
+ "onDataUpdate": onDataUpdate
});
}
diff -Naur old/contrail-webui-third-party/jnpr_slickgrid/slick.grid.css new/contrail-webui-third-party/jnpr_slickgrid/slick.grid.css
--- old/contrail-webui-third-party/jnpr_slickgrid/slick.grid.css 2014-05-05 13:33:23.000000000 -0700
+++ new/contrail-webui-third-party/jnpr_slickgrid/slick.grid.css 2014-09-03 12:08:05.000000000 -0700
@@ -81,7 +81,7 @@
}
.slick-row.ui-widget-content, .slick-row.ui-state-active {
- position: absolute;
+/* position: absolute; */
border: 0px;
width: 100%;
}
diff -Naur old/contrail-webui-third-party/jnpr_slickgrid/slick.grid.js new/contrail-webui-third-party/jnpr_slickgrid/slick.grid.js
--- old/contrail-webui-third-party/jnpr_slickgrid/slick.grid.js 2014-05-05 13:33:23.000000000 -0700
+++ new/contrail-webui-third-party/jnpr_slickgrid/slick.grid.js 2014-11-12 11:25:22.000000000 -0800
@@ -924,7 +924,7 @@
"." + uid + " .slick-header-column { left: 1000px; }",
"." + uid + " .slick-top-panel { height:" + options.topPanelHeight + "px; }",
"." + uid + " .slick-headerrow-columns { height:" + options.headerRowHeight + "px; }",
- "." + uid + " .slick-cell { height:" + rowHeight + "px; }",
+// "." + uid + " .slick-cell { height:" + rowHeight + "px; }",
"." + uid + " .slick-row { height:" + options.rowHeight + "px; }"
];
@@ -1418,7 +1418,7 @@
rowCss += " " + metadata.cssClasses;
}
- stringArray.push("<div class='ui-widget-content " + rowCss + "' style='top:" + getRowTop(row) + "px'>");
+ stringArray.push("<div class='ui-widget-content " + rowCss + " slick-row-master slick_row_" + ((d) ? d.cgrid : '') + "' data-cgrid='" + ((d) ? d.cgrid : '') + "'>");
var colspan, m;
for (var i = 0, ii = columns.length; i < ii; i++) {
@@ -1664,7 +1664,7 @@
}
if (h !== oldH) {
- $canvas.css("height", h);
+// $canvas.css("height", h);
scrollTop = $viewport[0].scrollTop;
}
@@ -2272,7 +2272,7 @@
// if this click resulted in some cell child node getting focus,
// don't steal it back - keyboard events will still bubble up
// IE9+ seems to default DIVs to tabIndex=0 instead of -1, so check for cell clicks directly.
- if (e.target != document.activeElement || $(e.target).hasClass("slick-cell")) {
+ if (options.editable && (e.target != document.activeElement || $(e.target).hasClass("slick-cell"))) {
setFocus();
}
}
@@ -2352,7 +2352,12 @@
}
function handleMouseEnter(e) {
- trigger(self.onMouseEnter, {}, e);
+ /* Added onclick onMousEnter for editors to get displayed */
+ var cell = getCellFromEvent(e);
+ if (options.editable) {
+ gotoCell(cell.row, cell.cell, true);
+ }
+ trigger(self.onMouseEnter, {}, e);
}
function handleMouseLeave(e) {