Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

renamed file

  • Loading branch information...
commit 51c18538a893bc08e84d843a7c6ee843d225051c 1 parent 542d307
@bobbywarner bobbywarner authored
View
19 src/groovy/grails/pjax/PjaxDecoratorMapper.groovy
@@ -0,0 +1,19 @@
+package grails.pjax
+
+import javax.servlet.http.HttpServletRequest
+import com.opensymphony.module.sitemesh.Page
+import com.opensymphony.module.sitemesh.Decorator
+import org.apache.commons.lang.StringUtils
+import org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper
+
+class PjaxDecoratorMapper extends GrailsLayoutDecoratorMapper {
+ public Decorator getDecorator(HttpServletRequest request, Page page) {
+ Decorator decorator = super.getDecorator(request, page)
+ if (request.getHeader("X-Pjax")) {
+ log.debug("PJAX enabled")
+ decorator = getNamedDecorator(request, "pjax")
+ }
+
+ return decorator
+ }
+}
View
38 src/groovy/grails/plugins/pjax/PjaxDecoratorMapper.groovy
@@ -1,38 +0,0 @@
-/**
- * Copyright 2012 Bobby Warner. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package grails.plugins.pjax
-
-import javax.servlet.http.HttpServletRequest
-import com.opensymphony.module.sitemesh.*
-import org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper
-import org.apache.commons.lang.StringUtils
-
-/**
- * PjaxDecoratorMapper
- *
- * @author Bobby Warner
- */
-class PjaxDecoratorMapper extends GrailsLayoutDecoratorMapper {
- public Decorator getDecorator(HttpServletRequest request, Page page) {
- Decorator decorator = super.getDecorator(request, page)
- if (request.getHeader("X-Pjax")) {
- log.debug("PJAX enabled")
- decorator = getNamedDecorator(request, "pjax")
- }
-
- return decorator
- }
-}
Please sign in to comment.
Something went wrong with that request. Please try again.