mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Adding a solution for single button inline forms
- used initially in the multitenancy tenant list. should be used anywhere we have/need destructive "links" --HG-- branch : dev
This commit is contained in:
@@ -20,10 +20,10 @@
|
|||||||
var t = tenant; %>
|
var t = tenant; %>
|
||||||
<%=Html.DisplayFor(m => t, string.Format("ActionsFor{0}", tenant.State.CurrentState), "") %><%=_Encoded(" | ")%><%
|
<%=Html.DisplayFor(m => t, string.Format("ActionsFor{0}", tenant.State.CurrentState), "") %><%=_Encoded(" | ")%><%
|
||||||
} %>
|
} %>
|
||||||
<%=Html.ActionLink(T("Edit").ToString(), "edit", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}, new {@class = "button"}) %><%
|
<%=Html.ActionLink(T("Edit").ToString(), "edit", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
|
||||||
if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
if (!string.Equals(tenant.Name, "default", StringComparison.OrdinalIgnoreCase)) { //todo: (heskew) base this off the view model so logic on what can be removed and have its state changed stays in the controller
|
||||||
%><%=_Encoded(" | ")%>
|
%><%=_Encoded(" | ")%>
|
||||||
<%=Html.ActionLink(T("Remove").ToString(), "delete", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}, new {@class = "button"}) %><%
|
<%=Html.ActionLink(T("Remove").ToString(), "delete", new {tenantName = tenant.Name, area = "Orchard.MultiTenancy"}) %><%
|
||||||
} %>
|
} %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
jQuery.fn.extend({
|
//todo: (heskew) make use of the autofocus attribute instead
|
||||||
|
jQuery.fn.extend({
|
||||||
helpfullyFocus: function() {
|
helpfullyFocus: function() {
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
var firstError = _this.find(".input-validation-error").first();
|
var firstError = _this.find(".input-validation-error").first();
|
||||||
@@ -19,6 +20,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// collapsable areas - anything with a data-controllerid attribute has its visibility controlled by the id-ed radio/checkbox
|
||||||
(function() {
|
(function() {
|
||||||
$("[data-controllerid]").each(function() {
|
$("[data-controllerid]").each(function() {
|
||||||
var controller = $("#" + $(this).attr("data-controllerid"));
|
var controller = $("#" + $(this).attr("data-controllerid"));
|
||||||
@@ -35,4 +37,19 @@
|
|||||||
$("[name=" + controller.attr("name") + "]").click(function() { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
|
$("[name=" + controller.attr("name") + "]").click(function() { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
})();
|
||||||
|
// inline form link buttons (form.inline.link button) swapped out for a link that submits said form
|
||||||
|
(function() {
|
||||||
|
$("form.inline.link").each(function() {
|
||||||
|
var _this = $(this);
|
||||||
|
var link = $("<a href='.'/>");
|
||||||
|
var button = _this.children("button").first();
|
||||||
|
link.text(button.text())
|
||||||
|
.css("cursor", "pointer")
|
||||||
|
.click(function() { _this.submit(); return false; })
|
||||||
|
.unload(function() { _this = 0; });
|
||||||
|
_this.replaceWith(link);
|
||||||
|
_this.css({ "position": "absolute", "left": "-9999em" });
|
||||||
|
$("body").append(_this);
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
@@ -56,6 +56,11 @@ body {
|
|||||||
min-width:94.6em; /* 946px */
|
min-width:94.6em; /* 946px */
|
||||||
padding:0;
|
padding:0;
|
||||||
}
|
}
|
||||||
|
/*todo: (heskew) find out why I need this...*/
|
||||||
|
button {
|
||||||
|
font-family:Segoe UI,Trebuchet,Arial,Sans-Serif;
|
||||||
|
font-size:1.01em;
|
||||||
|
}
|
||||||
body#preview {
|
body#preview {
|
||||||
min-width:0;
|
min-width:0;
|
||||||
}
|
}
|
||||||
@@ -158,14 +163,21 @@ p .button { font-size:inherit; }
|
|||||||
|
|
||||||
/* Links
|
/* Links
|
||||||
----------------------------------------------------------*/
|
----------------------------------------------------------*/
|
||||||
a, a:link, a:visited {
|
a, a:link, a:visited,
|
||||||
|
form.link button {
|
||||||
color:#1e5d7d;
|
color:#1e5d7d;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
|
form.link button {
|
||||||
|
height:1.3em;
|
||||||
|
}
|
||||||
a:hover, a:active, a:focus {
|
a:hover, a:active, a:focus {
|
||||||
color:#1e5d7d;
|
color:#1e5d7d;
|
||||||
text-decoration:underline;
|
text-decoration:underline;
|
||||||
}
|
}
|
||||||
|
form.link button:hover {
|
||||||
|
border-bottom:1px solid #1e5d7d;
|
||||||
|
}
|
||||||
|
|
||||||
/* Header - Branding and Login
|
/* Header - Branding and Login
|
||||||
----------------------------------------------------------*/
|
----------------------------------------------------------*/
|
||||||
@@ -466,11 +478,19 @@ button, .button, .button:link, .button:visited {
|
|||||||
color:#2d2f25;
|
color:#2d2f25;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
padding:0 .8em .1em .8em;
|
padding:0 .8em .1em;
|
||||||
}
|
}
|
||||||
button {
|
button {
|
||||||
padding-top:.08em;
|
padding-top:.08em;
|
||||||
}
|
}
|
||||||
|
form.link button {
|
||||||
|
background:inherit;
|
||||||
|
border:0;
|
||||||
|
padding:0;
|
||||||
|
width:auto;
|
||||||
|
margin:-2px -3px 0;
|
||||||
|
|
||||||
|
}
|
||||||
.primaryAction, .primaryAction:link, .primaryAction:visited {
|
.primaryAction, .primaryAction:link, .primaryAction:visited {
|
||||||
background:#4687ad;
|
background:#4687ad;
|
||||||
border:1px solid #8f8f8f;
|
border:1px solid #8f8f8f;
|
||||||
|
|||||||
Reference in New Issue
Block a user