使用Firefox的聚合物模板dom-repeat我得到ReferenceError:未定义事件,IE ok,chrome ok

时间:2016-04-18 17:08:23

标签: firefox polymer-1.0 polymer-starter-kit

以下Polymer代码适用于IE11和chrome V50

function intersect(obj1, obj2){
  var objBounds1 = obj1.nominalBounds.clone();
  var objBounds2 = obj2.nominalBounds.clone();

  var pt = obj1.globalToLocal(objBounds2.x, objBounds2.y);



  var h1 = -(objBounds1.height / 2 + objBounds2.height);
  var h2 = objBounds2.height / 2;
  var w1 = -(objBounds1.width / 2 + objBounds2.width);
  var w2 = objBounds2.width / 2;


  if(pt.x > w2 || pt.x < w1) return false;
  if(pt.y > h2 || pt.y < h1) return false;

  return true;
}
<template is="dom-repeat" items="[[buddys]]" as="partner">
 <paper-card style="width:100%;">
   <div class="card-content">
     [[partner.name]]

     <paper-icon-button 
            id="more-info"
            icon="more-horiz"
            on-click="_spielerDialog"
            data-index$="[[partner.__firebaseKey__]]"
            style="float:right;">
     </paper-icon-button>

  </div>
 </paper-card>
</template>

点击Firefox V 45.0.2的图标按钮后出现 ReferenceError:未定义事件

1 个答案:

答案 0 :(得分:0)

抱歉,事件的功能是解决方案

_spielerDialog: function(**event**) {