尝试在单击纸张按钮时打开此纸张对话框,但它似乎不想在 Chrome 之外工作。我觉得这个问题与它在 dom-repeat 中的事实有关,但我不确定你能给我的任何帮助都会非常感激。我在 Safari 中遇到的错误是“TypeError: dialog1.toggle() is not a function. (In 'dialog1.toggle()','dialog1.toggle' is undefined)”。在 Firefox 中,我刚刚收到“TypeError:dialog1.toggle 不是函数”。这是我的代码,希望有人能指出我正确的方向。
<script src="../bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="../bower_components/iron-ajax/iron-ajax.html">
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/paper-item/paper-item.html">
<link rel="import" href="../bower_components/paper-button/paper-button.html">
<link rel="import" href="../bower_components/paper-dialog/paper-dialog.html">
<link rel="import" href="../bower_components/paper-dialog-behavior/paper-dialog-behavior.html">
<link rel="import" href="../bower_components/paper-dialog-behavior/demo/simple-dialog.html">
<link rel="import" href="../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
<link rel="import" href="../bower_components/paper-listbox/paper-listbox.html">
<link rel="import" href="../bower_components/paper-dialog-scrollable/paper-dialog-scrollable.html">
<link rel="import" href="../bower_components/iron-demo-helpers/demo-snippet.html">
<link rel="import" href="../bower_components/iron-demo-helpers/demo-pages-shared-styles.html">
</head>
<body class="unresolved">
<template is="dom-bind">
<template is="dom-repeat" items="{{data}}">
<paper-button raised onclick$="dialog{{item.id}}.toggle()">{{item.series}} </paper-button>
<simple-dialog id$="dialog{{item.id}}">
<h2>{{item.series}}</h2>
<p>{{item.data}}</p>
</simple-dialog>
<br />
</template>
<iron-ajax auto id="GetData" url="get_category_data.php" handle-as="json" last-response="{{data}}" ></iron-ajax>
</template>
</body>