Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omitted style import in tutorial #167

Open
michpetrov opened this issue Feb 17, 2016 · 1 comment
Open

Omitted style import in tutorial #167

michpetrov opened this issue Feb 17, 2016 · 1 comment
Assignees

Comments

@michpetrov
Copy link

Last chapter in the Polymer tutorial.

<div class="vertical-section"> is added to the page but the class is not available in current imports, making the items look different than what's on the picture. The missing class seems to come from "paper-styles/demo-pages.html".

EDIT: "neon-animation/neon-animations.html" needs to be added as well, due to entry-animation="fade-in-animation", this one puts a warning in the console.

@99sono
Copy link

99sono commented Feb 21, 2016

Exactly, those imports are all lacking.

The entry point app needs to something as:

/**
 * Brings us glyph icons, such as those placed on the main nav menu.
 */
private static final String RESOURCE_POLYMER_IRON_ICONS = "iron-icons/iron-icons.html";

/** 
 * Needed to support the "fade-in-animation" on the paper fab button.
 */
private static final String RESOURCE_POLYMER_NEON_ANIMATIONS = "neon-animation/neon-animations.html";
/**
 * Paper demo pages contains the css style: "vertical-section",
 * needed by the "Item.ui.xml".
 */
private static final String RESOURCE_PAPER_DEMO_PAGES = "paper-styles/demo-pages.html";

/**
 * Resources placed under the com.vaading.polymer package, public/bower_components folder.
 */
private static final List<String> COM_VAADIN_POLYMER_PUBLIC_RESOURCES = Arrays.asList(RESOURCE_POLYMER_IRON_ICONS, RESOURCE_POLYMER_NEON_ANIMATIONS, RESOURCE_PAPER_DEMO_PAGES);
/**
 * This is the entry point method.
 */
public void onModuleLoad() {
    // boot-strap logic
    importPolymerResources();

}

private void importPolymerResources(){
    // We have to load icon sets before run application
    Polymer.importHref(COM_VAADIN_POLYMER_PUBLIC_RESOURCES, new Function() {
        public Object call(Object arg) {
            importPolymerResourcesCompleted();
            return null;
        }
    });
}    

private void importPolymerResourcesCompleted(){
    // The app is executed when all imports succeed.
    injectPolymerMenuIntoRootPanel();
}

/**
 * Finally load the main page.
 */
private void injectPolymerMenuIntoRootPanel(){
    RootPanel.get().add(new Main());
}

If you simulate loading the page with 3G ... it is quite a bit of load time with 97 web requests just to get started.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants