jquery.smallipop icon indicating copy to clipboard operation
jquery.smallipop copied to clipboard

Display onload

Open philwinkle opened this issue 11 years ago • 4 comments

Feature request: display smallipops onload without requiring use of the tour feature.

philwinkle avatar Jan 22 '14 07:01 philwinkle

Hi,

could you describe me your usecase?

Regards

Sebobo avatar Jan 22 '14 19:01 Sebobo

To display 4 or 5 tooltips simultaneously, onload, for a SPA demonstrating the featureset of that app.

This is likely a selfish feature request as my current workaround is something along the lines of generating a popupId for each when assigning the tooltips themselves; then forcing display by looping through: :

_.each(window.tooltips,function(tooltip){
    var options = $.extend(
        {
            theme: 'white',
            popupId: Math.floor( Math.random()*99999 )
        },
        tooltip.data
    );
    $(tooltip.selector).smallipop(options, tooltip.text);
});

//... some other stuff

//now display all at once
$('.smallipop-initialized').each(function(){
    $(this).smallipop('show');
});

philwinkle avatar Jan 22 '14 19:01 philwinkle

This is the way which I would have proposed ;)

The problem is, that one of the main features of smallipop is that it's only using one element and recycling it. So the only way of having multiple smallipops is having mutiple instances like in your example.

I'm not sure, how I should handle the behaviour of multiple popups which active at the same time. When should they hide, when should they show.

Sebobo avatar Jan 22 '14 21:01 Sebobo

Agreed - expanding the featureset is not worth compromising the core goal of the plugin. In that case, I would suggest that perhaps there is a way to pass a property in data to instruct a smallipop to display onload, rather than requerying the DOM to display only the first via the show method?

philwinkle avatar Jan 22 '14 22:01 philwinkle