mardi 10 avril 2018

iframe refresh failed in ambari web

I add a custom view to show something with iframe like below:

js:

var App = require('app');

App.CustomView = Em.View.extend({
  tagName: "iframe",
  classNames: ["views_sizes"],
  attributeBindings: ['src','height','seamless','allowfullscreen'],
  seamless: "seamless",
  height: "500px",
  allowfullscreen: "true",

  didInsertElement: function() {
    this.set('src','http://www.github.com');
  }
});

At first click, it shows github as expected, but when refresh, whole web break:

Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM.
    at K.Metamorph.checkRemoved (vendor.js:19469)
    at K.Metamorph.replaceWith (vendor.js:19448)
    at Object.<anonymous> (vendor.js:19769)
    at invoke (vendor.js:5036)
    at iter (vendor.js:5083)
    at Array.forEach (<anonymous>)
    at RunLoop.flush (vendor.js:5139)
    at RunLoop.end (vendor.js:5055)
    at Function.Ember.run.end (vendor.js:5247)
    at autorun (vendor.js:5313)

I am new about ember.js, and i can not search an useful solution until now, could someone know it?




Aucun commentaire:

Enregistrer un commentaire