Problems displaying expanded/collapsed sections

102 views
Skip to first unread message

bananos

unread,
Jun 29, 2012, 4:01:47 AM6/29/12
to raple...@googlegroups.com
Hi there!
I'm trying to play around with example from here: 


And returning JSONP from my PHP script:

<?php
header("Content-type: text/javascript");
//Parameters in the request from Rapportive to our Raplet
$callback = isset($_GET['callback'])? $_GET['callback'] : "cb";
?>
<?=$callback?>({
    "status": 200,
    "css": "h2.name { color: grey; }\n .collapsed { white-space: nowrap; overflow: hidden; }",
    "js": "$('h2.name').click(function(){ $(this).text('You clicked me!'); });",
    "sections": [
        {
            "expanded_html": "<h2 class='name'>Rahul Vohra</h2><p>Lifetime value: $1,000,000!</p>",
            "collapsed_html": "<div class='collapsed'>$1,000,000</div>"
        }
    ]
})


I've figured out that display of expanded or collapsed HTML depends on browser's viewport height and total height of Rapportive widget.
At some point I thought I broke smth. and spent a whole day trying to force Rapportive to display my collapsed version by default & expanded on hover event.
My question is as following:
  - Is there any way to force display of collapsed version only which does not depend on browser's/rapportive widget height?   

p.s. And probably you should somehow stress this thing with height behavior in your docs, because it really confuses at the beginning and may lead to huge loss of time
 

Gary Sherman

unread,
Nov 1, 2012, 6:56:29 PM11/1/12
to raple...@googlegroups.com
I'm experiencing the same issue.
Trying to test the expanded/collapsed sections, and I can only get it to show the expanded section in the sidebar.
I haven't been able to see the collapsed section actually display.
I've tried re-sizing my browser to no avail.

Any tips of how to get it to show the collapsed section?
You mentioned the "total height of Rapportive widget". Is that of the entire sidebar? or just my raplet?
How can I adjust that?

And I have the same question as the OP:
Is there any way to force display of collapsed version only which does not depend on browser's/rapportive widget height?   

TIA

Conrad Irwin

unread,
Nov 1, 2012, 7:05:25 PM11/1/12
to raple...@googlegroups.com
Hi Gary,

Thanks for getting in touch, and thanks for developing a raplet :).

The best way to force a collapsed section to show up is to find a sidebar with two expanded sections (for example, my sidebar has an expanded twitter section and an expanded membership section). Then shrink the browser window until only one is expanded.

Once you've done that, then the most recently clicked section will be expanded, and all other sections will be collapsed. So you can collapse your raplet by clicking on a different section.

Please let me know how you get on,

Conrad
Developer, Rapportive.


--
You received this message because you are subscribed to the Google
Groups "Raplet developer discussion list" group.
To post to this group, send email to raple...@googlegroups.com
To unsubscribe from this group, send email to
raplet-dev+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/raplet-dev?hl=en

Gary Sherman

unread,
Nov 2, 2012, 10:39:35 AM11/2/12
to raple...@googlegroups.com
Hi Conrad,

Following your suggestion, I was finally able to see the collapsed and expanded sections properly.

Thanks!

Reply all
Reply to author
Forward
0 new messages