I need to get fancytree instance from iframe, but trying to call
$(top.document).contents().find('#tree').fancytree('getTree')
results in error:
Uncaught Error: cannot call methods on fancytree prior to initialization
The tree is initialized and accessible from top document context. Any ideas?
Edit: iframe is on the same domain.
Ok. Solved - I had to keep tree in global variable after initialization in top document:
tree = $('#tree').fancytree('getTree');
and then refer to it from iframe like this:
top.tree.doSth();
Related
I have this Jetstream Laravel application, which has a presence channel set up for chat features.
What's happening is:
When I join the channel and send a message there, everything works fine, except when I try to exit the channel. In every navigation link, the error Uncaught DOMException: Failed to execute 'replaceState' on 'History': #<Object> could not be cloned. is triggered.
Not sure what is causing it...
Curious Fact:
When I join the channel, and leave it, without sending any message, it works as expected. I visit the page that I was supposed to visit, without any error.
You should not change the props who is coming from $page.props.{propName}
Instead if you want to make some changes on a prop like your app {messages}
you should create a new object or array from the prop:
const messages = ref([...page.props.value.messages]);
Now you can change the messages object as many as you want:
messages.push(newMessage)
I'm trying to mix motion-layout and Teacup in a RubyMotion project. I've created an example view helper to illustrate my problem:
module Teacup::Layout
def example(name, options = {})
subview UIView, name do
subview UILabel, "#{name}_label".to_sym, text: options[:label]
auto do
horizontal "|-[#{name}_label]-|"
end
end
end
end
When I call example(:example), text: "Test" inside a layout block, my code throws the following exception:
(main)> 2013-10-25 13:40:45.989 rui[55552:80b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse constraint format:
example_label is not a key in the views dictionary.
H:|-[example_label]-|
If I omit the motion-layout code and inspect the views, the example_label view is a child of the example view. What's going on here?
In the documentation for Teacup, it says:
# if you need to apply these to a different view, or if you want to assign
# different names to use in the ASCII strings
# auto(layout_view=self.view, layout_subviews={}, &layout_block)
Due to the 'dynamic' nature of the creation of all these views, and the layout (motion-layout) being in a subview instead of a layout (teacup), it just might be getting confused, though subview and layout are similar.
Anyway, try being very specific about which views are going into the auto block using the suggestion from the documentation, then there can be no ambiguity about what should be in the layout.
I get the following error when i try to call destroy function to my Backbone Model:
Uncaught TypeError: Cannot call method 'apply' of undefined backbone-firebase.js:126
Backbone.Firebase.sync backbone-firebase.js:126
Backbone.sync backbone-firebase.js:154
h.extend.sync backbone-min.js:1
h.extend.destroy backbone-min.js:1
Backbone.View.extend.remove sample.html:79
p.event.dispatch jquery.min.js:2
g.handle.h
Code: http://dl.dropboxusercontent.com/u/14749491/sample.html
Since you're using the "implicit" sync method, don't use destroy to remove the model, use the remove method on the collection instead.
If you'd like to use destroy, I recommend using the "explicit" sync method,,using Backbone.Collection.extend with a firebase property. More information on these two methods here: https://github.com/firebase/backfire
I don't know anything about BackFire. But it appears to be a conflict between FireBase and BackBone-FireBase. Since the code you are loading from the FireBase cdn is minified method names (like delete in this case) have been changed. Try using the unminified version of FireBase and see if it works correctly.
i tried to use Meteor.renderList to render some sort of chat messages. I use the Template.foo.rendered callback method to add the domFragment to a list.
Template.foo.rendered = ->
list = this.find "ul"
list.appendChild fragmet
If I place the list inside <template name="foo"> Meteor throws errors in an endless loop/recursion.
Uncaught Error: LiveRange start and end must have a parent
I have to use another template thats not directly connected to foo. Appending the list from within the foo#rendered callback than works as expected.
Template.foo.rendered = ->
document.getElementById("foo").appendChild fragmet # element with id foo not part of template foo
I think, that there is a problem with the reactive contextes used by the template and renderList? Anyone knows if this is a bug or the expected behavior? I looked into the sources but was lost in there quite fast ;)
Thanks!
This makes sense because you are appending an element to the template when the template is rendered. So, every time the template is rendered, it appends an element to itself, causing it to re-render itself, ad infinitum.
Are you sure you want Meteor.renderList to render your list rather than using an {{each}} iterator in the template itself?
I have a flex4 applciation (mx+spark). When I use:
FlexGlobals.topLevelApplication.styleManager.loadStyleDeclarations(skinName, true);
This works fine: new style is applied.
The trouble is when I apply a new style, it mixes both: this happens because I need to Unload style first.
I try to unload it with:
FlexGlobals.topLevelApplication.styleManager.unloadStyleDeclarations("style/normal.swf",false);
And I always got an error:
ReferenceError: Error #1069: La property 0 cannot be found on Number
and there is no default value.
at normal/unloadOverrides()[null/normal-generated.as:721]
at normal/unload()[null/normal-generated.as:676]
Any idea on how to load/unload swf css in Flex4?
The styles will be updated the next time one of the following methods is called with the update property set to true:
clearStyleDeclaration()
loadStyleDeclarations()
setStyleDeclaration()
unloadStyleDeclarations()
Typically, if you call the one of these methods multiple times, you set this property to true only on the last call, so that Flex does not call the styleChanged() method multiple times.
More information here.