From 92e9851d46dca5751db859f8786d78b7a47382c7 Mon Sep 17 00:00:00 2001 From: Nathan Heskew Date: Tue, 9 Nov 2010 08:52:25 -0800 Subject: [PATCH] Ensuring the Blog SummaryAdmin template pulls in required scripts and making a couple JS functions better jQuery citizens --HG-- branch : dev --- src/Orchard.Web/Core/Shapes/Scripts/base.js | 7 ++++--- .../Views/Items/Content-Blog.SummaryAdmin.cshtml | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Orchard.Web/Core/Shapes/Scripts/base.js b/src/Orchard.Web/Core/Shapes/Scripts/base.js index d4ee65f70..98a44ad29 100644 --- a/src/Orchard.Web/Core/Shapes/Scripts/base.js +++ b/src/Orchard.Web/Core/Shapes/Scripts/base.js @@ -85,11 +85,12 @@ var firstError = _this.find(".input-validation-error").first(); // try to focus the first error on the page if (firstError.size() === 1) { - return firstError.focus(); + firstError.focus(); + return _this; } // or, give it up to the browser to autofocus if ('autofocus' in document.createElement('input')) { - return; + return _this; } // otherwise, make the autofocus attribute work var autofocus = _this.find(":input[autofocus]").first(); @@ -102,7 +103,7 @@ // give it up to the browser to handle placeholder text if ('placeholder' in document.createElement('input')) { - return; + return _this; } // otherwise, make the placeholder attribute work $(":input[placeholder]") diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml index 63bce04f0..021cd18a0 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Items/Content-Blog.SummaryAdmin.cshtml @@ -3,8 +3,9 @@ @using Orchard.ContentManagement; @using Orchard.Utility.Extensions; @{ - ContentItem contentItem = Model.ContentItem; - var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); + Script.Require("ShapesBase"); + ContentItem contentItem = Model.ContentItem; + var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); }