manolo / gwt-polymer-elements

Polymer Web Components for GWT. A collection of Material Design widgets for desktop and mobile.
Apache License 2.0
155 stars 49 forks source link

Polymer.importHref callback breaks uibinder css rules. #125

Closed bmartin1134 closed 8 years ago

bmartin1134 commented 8 years ago

The callback for importHref isn't able to find the css rules and applies a blank rule. Moving the startApp(); out of the importHref function allows the css to load but I don't know if there other unintended consequences of adding the elements before the import finishes.

`public class Designer implements EntryPoint {

/**
 * This is the entry point method.
 */
public void onModuleLoad() {
    Polymer.importHref(Arrays.asList(PaperButtonElement.SRC), new Function() {
        public Object call(Object arg) {
            // The app is executed when all imports succeed.

           startApp();
            return null;
        }
    });
}

private void startApp() {
    RootPanel.get().add(new CSSBinder());

}

}`

bmartin1134 commented 8 years ago

Ah I got it, instructions in the documentation are unclear. The callback function should be Designer.this.startApp();