You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Ernesto Reinaldo Barreiro (JIRA)" <ji...@apache.org> on 2011/04/11 13:55:05 UTC

[jira] [Updated] (WICKET-3607) make ModalWindow CSS contibution more configurable

     [ https://issues.apache.org/jira/browse/WICKET-3607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ernesto Reinaldo Barreiro updated WICKET-3607:
----------------------------------------------

    Attachment: ModalWindow.patch

patch to FIX the issue

> make ModalWindow CSS contibution more configurable
> --------------------------------------------------
>
>                 Key: WICKET-3607
>                 URL: https://issues.apache.org/jira/browse/WICKET-3607
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.17, 1.5-RC3
>         Environment: any
>            Reporter: Ernesto Reinaldo Barreiro
>            Priority: Minor
>              Labels: wicket
>         Attachments: ModalWindow.patch
>
>   Original Estimate: 1m
>  Remaining Estimate: 1m
>
> Right now if you want to modify the CSS of ModalWindow you still get added to page the original CSS as it is included in
> /**
> 	 * Initialize
> 	 */
> 	private void init()
> 	{
> 		setVersioned(false);
> 		cookieName = null;
> 		add(empty = new WebMarkupContainer(getContentId()));
> 		add(newCloseButtonBehavior());
> 		add(new WindowClosedBehavior());
> 		add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT));
> 		add(CSSPackageResource.getHeaderContribution(CSS));
> 	}
> I propose to do this as
> /**
> 	 * Initialize
> 	 */
> 	private void init()
> 	{
> 		setVersioned(false);
> 		cookieName = null;
> 		add(empty = new WebMarkupContainer(getContentId()));
> 		add(newCloseButtonBehavior());
> 		add(new WindowClosedBehavior());
> 		add(JavascriptPackageResource.getHeaderContribution(JAVASCRIPT));
> 		ResourceReference CSS = newCssResource();
> 		if (CSS != null)
> 			add(CSSPackageResource.getHeaderContribution(CSS));
> 	}
> 	/**
> 	 * Allows to override CSS contribution. Returning null means the CSS will be contributed via
> 	 * other sources, e.g. a global CSS resource.
> 	 * 
> 	 * @return The CSS resource reference or null if CSS is contributed via other means.
> 	 */
> 	protected ResourceReference newCssResource()
> 	{
> 		return CSS;
> 	}
> This will allow to easily override the CSS file.... or avoid including one (returning null)... in case the CSS is part of a "global" page CSS... Existing applications will not be affected 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira