@ Override public void renderHead ( IHeaderResponse response ) { super . renderHead ( response ) ; response . render ( JavaScriptHeaderItem . forReference ( DRAWER_JAVASCRIPT ) ) ; response . render ( JavaScriptHeaderItem . forReference ( MANAGER_JAVASCRIPT ) ) ; response . render ( CssHeaderItem . forReference ( DRAWER_CSS ) ) ; Iterator < ListItem > iter = drawers . descendingIterator ( ) ; WebMarkupContainer drawer ; while ( iter . hasNext ( ) ) { drawer = iter . next ( ) . item ; response . render ( OnDomReadyHeaderItem . forScript ( "$('#" + drawer . getMarkupId ( ) + "').modaldrawer('show');" ) ) ; if ( drawers . getFirst ( ) . item . equals ( drawer ) ) { response . render ( OnDomReadyHeaderItem . forScript ( "$('#" + drawer . getMarkupId ( ) + "').addClass('shown-modal');" ) ) ; response . render ( OnDomReadyHeaderItem . forScript ( "$('#" + drawer . getMarkupId ( ) + "').removeClass('hidden-modal');" ) ) ; } else { response . render ( OnDomReadyHeaderItem . forScript ( "$('#" + drawer . getMarkupId ( ) + "').removeClass('shown-modal');" ) ) ; response . render ( OnDomReadyHeaderItem . forScript ( "$('#" + drawer . getMarkupId ( ) + "').addClass('hidden-modal');" ) ) ; } } }
pressing the Back button and landing on a page with open drawers .