Hello,

We are using tapestry5.4 beta-3 and was attempting to add bootstrap
tooltip and popover scripts.

When using just the attributes as described on
http://getbootstrap.com/javascript/#popovers, it appeared that the
attributes were not being recognized.

We were able to get the tooltip & popover to work by including the
following scripts, which suggests that the initializer scripts are
missing?

Below sample is working:

test.java:
package org.company.demo;

import org.apache.tapestry5.annotations.Import;

@Import(module = {"bootstrap/modal", "bootstrap/popover", "tooltip-popover"})
public class Test {
}

test.tml:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd";
      xmlns:p="tapestry:parameter">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    </head>
    <body>

        <p id="tool" class="muted" style="margin-bottom: 0;">Tight
pants next level keffiyeh <a href="#" data-toggle="tooltip"
data-placement="right" title="Default tooltip">you probably</a>
haven't heard of them. Photo booth beard raw denim letterpress vegan
messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie
sustainable quinoa 8-bit american apparel <a href="#"
data-toggle="tooltip" title="Another tooltip">have a</a> terry
richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo
thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's
cleanse vegan chambray. A really ironic artisan <a href="#"
data-toggle="tooltip" title="Another one here too">whatever
keytar</a>, scenester farm-to-table banksy Austin <a href="#"
data-toggle="tooltip" title="The last tip!">twitter handle</a> freegan
cred raw denim single-origin coffee viral.</p>

        <div id="myDiv">
            <a id="pop"
               href="#"
               class="btn btn-lg btn-danger"
               data-toggle="popover-hover"
               data-title="Title goes here"
               data-content="And here's some amazing content. It's
very engaging. right?"
               >Hover to toggle popover</a>
            <a href="#" data-toggle="tooltip" title="Some tooltip text
title!">Hover over me</a>
            <button type="button" id="pop" class="btn btn-default"
data-container="body" data-title="Title goes here"
data-toggle="popover-click" data-placement="left"
data-content="Vivamus sagittis lacus vel augue laoreet rutrum
faucibus.">
                Popover on Click
            </button>
        </div>

    </body>
</html>

the above will work with the following file added
tooltip-popover:
define(["jquery", "bootstrap/tooltip", "bootstrap/popover"], function($) {

    init = function() {
        $('[data-toggle="tooltip"]').tooltip({'placement': 'auto right'});

        $('[data-toggle="popover-click"]').popover({
            trigger: 'click',
            'placement': 'auto right'
        });

        $('[data-toggle="popover-hover"]').popover({
            trigger: 'hover',
            'placement': 'auto right'
        });
    };

    return init;
});

Is there supposed to be an initializer added to existing code for the
tootlip and popover libriaries?

Thanks,
Jim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to