General Problem Problems can arise, when one trys to integrate DOM Manipulating 3rd Party libraries. In this particular case, a jQuery Lightbox plugin caused problems.
Original Question Currently i am trying to integrate the following Lightboxplugin into an Ember View: http://codecanyon.net/item/jquery-lightbox-evolution/115655
This is my current code for the View:
App.LightboxView = Ember.View.extend({
templateName : 'whatever',
isVisible : false,
willInsertElement : function(){
var that = this;
$.lightbox(this.$(),{
width : 600,
height : 850,
onOpen : function(){
that.$().fadeIn(400);
that.set("isVisible", true);
},
});
},
});
This approach is working quite fine as it is starting the plugin in the moment the View is inserted into the DOM and everything is displayed fine. Ember seems to insert the resulting html of the View into the DOM and the lightbox plugin fetches the DOM Element and places it into the place where it is needed for the lightbox to work. But this is where the problems start. Actions do not work anymore in my view. I have some {{action}} helpers in my view and none of them works (they are working when i don't use the lightbox). I assume this is because the plugin makes manipulations to the DOM, but Ember wants to be the only one to manipulate the DOM.
Can anyone offer some guidance here? This is the first time i am developing/utilizing a lightbox, so this could cause additional problems :-)