Bootjack Modal生成异常:类'TransitionEvent'没有实例getter'relatedTarget'

时间:2015-09-02 09:34:03

标签: modal-dialog dart rikulo bootjack

我使用Rikulo / Bootjack在模态窗口中输入参数,但是dquery在DartEditor-1.10.1(Win7和Linux)中使用Preferences:Run生成多个异常“Class'TransitionEvent'没有实例getter'relatedTarget'”和调试:中断异常:全部。问题是什么?以下是示例代码:

的index.html:

<html>
<head>
  <meta charset="utf-8">
  <title>bootjack_test</title>
  <link rel="stylesheet" href="packages/bootjack/css/bootstrap.min.css">
  <script async src="main.dart" type="application/dart"></script>
</head>
<body>
  <a href="#modalNewItem" role="button" class="btn btn-primary" data-toggle="modal">New item</a>
  <div id="modalNewItem" class="modal fade" tabindex="-1" role="dialog">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal">&times;</button>
          <h4>New item creation:</h4>
        </div>
        <div class="modal-body">
          Item name:&nbsp;<input type="text" id="inputItemName">
        </div>
        <div class="modal-footer">
          <button class="btn btn-default" data-dismiss="modal">Cancel</button>&nbsp;&nbsp;&nbsp;
          <button class="btn btn-primary" id="btnCreateItem">Create</button>
        </div>
      </div>
    </div>
  </div>
</body>
</html>

main.dart:

import 'dart:html';
import 'package:dquery/dquery.dart';
import 'package:bootjack/bootjack.dart';

void main() {
  Modal.use();
  Transition.use();
  Modal modal = Modal.wire(querySelector('#modalNewItem'));

  $('#btnCreateItem').on('click', (QueryEvent e) {
    var itemName = (querySelector('#inputItemName') as TextInputElement).value.trim();
    if (itemName.length == 0) {
      print('ERROR: empty item name');
    } else {
      print('OK: item name = $itemName');
      modal.hide();
    }
  });
}

问题在rikulo / bootjack的bootjack example / modal中重现 GitHub,我打开了相应的问题请求:https://github.com/rikulo/bootjack/issues/25

1 个答案:

答案 0 :(得分:2)

修复了dquery,请运行pub upgrade将dquery升级到0.7.1 + 1.