Hi all,
I also posted this question over a SO: http://stackoverflow.com/questions/17812201/drop-target-issue
In a nutshell, I want to give my image drop targets a little more meat on the page so they're easier to see and drag to, but the drop zone doesn't seem to "activate" DAM resources dragged onto it until the edit dialog is opened at least once.
Here's my code:
ResponsiveImage leftImage = new ResponsiveImage(resource, "panelLeftImage");
if (leftImage.hasContent() || WCMMode.fromRequest(request) == WCMMode.EDIT) {
leftImage.addCssClass(DropTarget.CSS_CLASS_PREFIX + "panelLeftImage");
leftImage.setSelector(".img");
leftImage.setDoctype(Doctype.fromRequest(request));
}
<%
if (leftImage != null && leftImage.hasContent()) { leftImage.draw(out); }
else { leftImage.setSelector(".img"); out.print("<img class=\"" + DropTarget.CSS_CLASS_PREFIX + "panelLeftImage" + "\" src=\"http://placehold.it/300x300\" />"); }
%>
The drop zone definitely works, as I get the highlight around the custom element I printed out, but images don't render/activate when dropped onto it until I've opened the component dialog.
Thanks!