Skip to content

Commit 3e415ff

Browse files
Natan PirardRockinRoel
authored andcommitted
WT-10842: Eliminate jQuery usage in WTableView.C
- replace trigger and $.event.fix() by dispatchEvent()
1 parent 81d7b22 commit 3e415ff

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Wt/WTableView.C

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void WTableView::setup()
116116

117117
canvas_->clicked().connect
118118
("function(o, e) { "
119-
"""$(document).trigger($.event.fix(e));"
119+
"""document.dispatchEvent(new Event(e.type, e));"
120120
"}");
121121

122122
canvas_->clicked().preventPropagation();
@@ -125,14 +125,14 @@ void WTableView::setup()
125125
std::placeholders::_1));
126126
canvas_->mouseWentDown().preventPropagation();
127127
canvas_->mouseWentDown().connect("function(o, e) { "
128-
"$(document).trigger($.event.fix(e));"
128+
"document.dispatchEvent(new Event(e.type, e));"
129129
"}");
130130
canvas_->mouseWentUp().connect
131131
(this, std::bind(&WTableView::handleMouseWentUp, this, false,
132132
std::placeholders::_1));
133133
canvas_->mouseWentUp().preventPropagation();
134134
canvas_->mouseWentUp().connect("function(o, e) { "
135-
"$(document).trigger($.event.fix(e));"
135+
"document.dispatchEvent(new Event(e.type, e));"
136136
"}");
137137
canvas_->addWidget(std::unique_ptr<WWidget>(table_));
138138

@@ -165,21 +165,21 @@ void WTableView::setup()
165165
(this, std::bind(&WTableView::handleSingleClick, this, true,
166166
std::placeholders::_1));
167167
headerColumnsCanvas_->clicked().connect("function(o, e) { "
168-
"$(document).trigger($.event.fix(e));"
168+
"document.dispatchEvent(new Event(e.type, e));"
169169
"}");
170170
headerColumnsCanvas_->mouseWentDown().preventPropagation();
171171
headerColumnsCanvas_->mouseWentDown().connect
172172
(this, std::bind(&WTableView::handleMouseWentDown, this, true,
173173
std::placeholders::_1));
174174
headerColumnsCanvas_->mouseWentDown().connect("function(o, e) { "
175-
"$(document).trigger($.event.fix(e));"
175+
"document.dispatchEvent(new Event(e.type, e));"
176176
"}");
177177
headerColumnsCanvas_->mouseWentUp().preventPropagation();
178178
headerColumnsCanvas_->mouseWentUp().connect
179179
(this, std::bind(&WTableView::handleMouseWentUp, this, true,
180180
std::placeholders::_1));
181181
headerColumnsCanvas_->mouseWentUp().connect("function(o, e) { "
182-
"$(document).trigger($.event.fix(e));"
182+
"document.dispatchEvent(new Event(e.type, e));"
183183
"}");
184184
headerColumnsCanvas_->addWidget
185185
(std::unique_ptr<WWidget>(headerColumnsTable_));

0 commit comments

Comments
 (0)