Closed amahdy closed 9 years ago
Code by @tomivirkki
I don't like this approach since it does not fix the component for it's usage in gwt projects, it's just for demo. There is a new feature in generator, so if you have a PaperTabsBase.java in the folder lib/[papert-tabs-namespace] then PaperTabs.java would extend it instead of PolymerWidget which should be extended by the PaperTabsBase. in PaperTabsBase we could override the onAttach call and do the hack.
Review status: 0 of 1 files reviewed at latest revision, all discussions resolved, all commit checks successful.
Comments from the review on Reviewable.io
Adding PaperTabsBase.java under lib/com/vaadin/polymer/paper/widget works as expected.
Tried this code and didn't work:
package com.vaadin.polymer.paper.widget;
import com.google.gwt.core.client.JavaScriptObject;
import com.vaadin.polymer.PolymerWidget;
import com.google.gwt.user.client.Element;
public class PaperTabsBase extends PolymerWidget {
public PaperTabsBase(String tag, String src, String html) {
super(tag, src, html);
}
@Override
protected void onAttach() {
super.onAttach();
fixTabsSelection(this.getElement());
}
// A temporary workaround to fix the underline tab issue
// Not a solution.
private native void fixTabsSelection(Element element) /*-{
element._onResize();
}-*/;
}
Browser gives: element_0_g$._onResize is not a function