Promises broken by an iframe…

(Joe Seyfried) #1

Sorry about the title, feeling a little poetic today.

Here’s what I came across: in a

    didInsertElement: function() {

I am trying to talk to the Ruby server with an AJAX request. The very same code should also work for an iframe (a kludge I am using for a proof-of-concept). And: it doesn’t.

The promise gets executed by the main frame, not the iframe. I am currently desperate enough to poke data from the main frame though to the iframe via an attribute of the iframe element - but that should not be the only solution, I hope?

(Kane York) #2

If you want to do cross-domain messaging with two separate domains, an iframe and postMessage should do it. (That’s how you poke data.)

If you just want a ‘frame’ to stick Discourse content in, why not do it with Handlebars?

(Joe Seyfried) #3

I think I might actually be at the point where it’s less work for me to do that… are there any hidden treasure threads lying around here on this topic (did a quick search, but came up with nothing in particular)?

(Kane York) #4

Look at @sam’s topic list view for how to do Handlebars overrides & new templates in </head>.

(Joe Seyfried) #5

I am currently stuck a little bit trying to find my way through the topic representation in Ember. I have created a button that will reveal a dropdown box that should receive a given topic.

I have a handlebar file, derived a view, and poked around the controller and model files, too - but I am currently stuck in the depths of Topic, postStream and how to display stuff - naïvely, I thought that I could simply set the topicID somewhere, and that should suffice to display that topic, but this is obviously not the case.

How to put a specific topic into a box for a shoutbox plugin