Ensuring the Blog SummaryAdmin template pulls in required scripts and making a couple JS functions better jQuery citizens

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-09 08:52:25 -08:00
parent 2bd0e7acaf
commit 92e9851d46
2 changed files with 7 additions and 5 deletions

View File

@@ -85,11 +85,12 @@
var firstError = _this.find(".input-validation-error").first(); var firstError = _this.find(".input-validation-error").first();
// try to focus the first error on the page // try to focus the first error on the page
if (firstError.size() === 1) { if (firstError.size() === 1) {
return firstError.focus(); firstError.focus();
return _this;
} }
// or, give it up to the browser to autofocus // or, give it up to the browser to autofocus
if ('autofocus' in document.createElement('input')) { if ('autofocus' in document.createElement('input')) {
return; return _this;
} }
// otherwise, make the autofocus attribute work // otherwise, make the autofocus attribute work
var autofocus = _this.find(":input[autofocus]").first(); var autofocus = _this.find(":input[autofocus]").first();
@@ -102,7 +103,7 @@
// give it up to the browser to handle placeholder text // give it up to the browser to handle placeholder text
if ('placeholder' in document.createElement('input')) { if ('placeholder' in document.createElement('input')) {
return; return _this;
} }
// otherwise, make the placeholder attribute work // otherwise, make the placeholder attribute work
$(":input[placeholder]") $(":input[placeholder]")

View File

@@ -3,6 +3,7 @@
@using Orchard.ContentManagement; @using Orchard.ContentManagement;
@using Orchard.Utility.Extensions; @using Orchard.Utility.Extensions;
@{ @{
Script.Require("ShapesBase");
ContentItem contentItem = Model.ContentItem; ContentItem contentItem = Model.ContentItem;
var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString(); var returnUrl = ViewContext.RequestContext.HttpContext.Request.ToUrlString();
} }