~mhier/libwt-latest/libwt-package

« back to all changes in this revision

Viewing changes to src/Wt/WSuggestionPopup.C

  • Committer: Martin Hierholzer
  • Date: 2020-06-18 12:21:07 UTC
  • Revision ID: martin.hierholzer@desy.de-20200618122107-jxk2kefgptu2hh3v
update to upstream version 4.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
 
2
 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
3
3
 *
4
4
 * See the LICENSE file for terms of use.
5
5
 */
149
149
{
150
150
  std::string jsFunction = 
151
151
    "function(obj, event) {"
152
 
    """var o = jQuery.data(" + jsRef() + ", 'obj');"
153
 
    """if (o) o." + methodName + "(obj, event);"
 
152
    """var o = " + jsRef() + ";"
 
153
    """if (o && o.wtObj) o.wtObj." + methodName + "(obj, event);"
154
154
    "}";
155
155
  s.connect(jsFunction);
156
156
}
196
196
    defaultValue_ = row;
197
197
 
198
198
    if (isRendered())
199
 
      doJavaScript("jQuery.data(" + jsRef() + ", 'obj').defaultValue = "
 
199
      doJavaScript(jsRef() + ".wtObj.defaultValue = "
200
200
                   + std::to_string(defaultValue_)
201
201
                   + ';');
202
202
  }
215
215
    return;
216
216
 
217
217
  for (int i = start; i <= end; ++i) {
218
 
    WContainerWidget *line = impl_->insertWidget(i, std::unique_ptr<WContainerWidget>(new WContainerWidget()));
 
218
    WContainerWidget *line = impl_->insertWidget(i, cpp14::make_unique<WContainerWidget>());
219
219
 
220
220
    WModelIndex index = model_->index(i, modelColumn_);
221
221
 
223
223
 
224
224
    TextFormat format = index.flags().test(ItemFlag::XHTMLText) ? 
225
225
      TextFormat::XHTML : TextFormat::Plain;
226
 
    WAnchor *anchor = line->addWidget(std::unique_ptr<WAnchor>(new WAnchor()));
227
 
    WText *value = anchor->addWidget(std::unique_ptr<WText>(new WText(asString(d), format)));
 
226
    WAnchor *anchor = line->addWidget(cpp14::make_unique<WAnchor>());
 
227
    WText *value = anchor->addWidget(cpp14::make_unique<WText>(asString(d), format));
228
228
 
229
229
    cpp17::any d2 = index.data(editRole_);
230
230
    if (!cpp17::any_has_value(d2))
318
318
 
319
319
void WSuggestionPopup::showAt(WFormWidget *edit)
320
320
{
321
 
  doJavaScript("jQuery.data(" + jsRef() + ", 'obj').showAt("
 
321
  doJavaScript(jsRef() + ".wtObj.showAt("
322
322
               + edit->jsRef() + ");");
323
323
}
324
324
 
371
371
   * before the updated children (suggestions) are rendered.
372
372
   */
373
373
  WApplication::instance()->
374
 
    doJavaScript("jQuery.data(" + jsRef() + ", 'obj').filtered("
 
374
    doJavaScript(jsRef() + ".wtObj.filtered("
375
375
                 + WWebWidget::jsStringLiteral(input) + ","
376
376
                 + (partialResults() ? "1" : "0") + ");");
377
377
}