Quantcast
Channel: Adobe Community : Unanswered Discussions - Digital Marketing Suite
Viewing all articles
Browse latest Browse all 937

Image placeholders for drop targets?

$
0
0

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!


Viewing all articles
Browse latest Browse all 937


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>