mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 10:07:55 +08:00
Upgrading base.js to handle data-controllerid on <select/>
--HG-- branch : 1.x
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
@model Orchard.Core.Common.ViewModels.TextFieldDriverViewModel
|
||||
|
||||
<label for="@Html.FieldIdFor(m => m.Text)">@Model.Field.DisplayName</label>
|
||||
<fieldset>
|
||||
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
|
||||
@Html.TextBoxFor(m => m.Text, new { @class = "text" })
|
||||
@Html.ValidationMessageFor(m => m.Text)
|
||||
}
|
||||
else {
|
||||
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor)
|
||||
}
|
||||
<span class="hint">@Model.Settings.Hint</span>
|
||||
<label for="@Html.FieldIdFor(m => m.Text)">@Model.Field.DisplayName</label>
|
||||
@if (String.IsNullOrWhiteSpace(Model.Settings.Flavor)) {
|
||||
@Html.TextBoxFor(m => m.Text, new { @class = "text" })
|
||||
@Html.ValidationMessageFor(m => m.Text)
|
||||
}
|
||||
else {
|
||||
@Display.Body_Editor(Text: Model.Text, EditorFlavor: Model.Settings.Flavor)
|
||||
}
|
||||
<span class="hint">@Model.Settings.Hint</span>
|
||||
</fieldset>
|
||||
|
@@ -137,7 +137,7 @@
|
||||
var _this = $(this);
|
||||
var _controllees = $("[data-controllerid=" + _this.attr("id") + "]");
|
||||
var _controlleesAreHidden = _controllees.is(":hidden");
|
||||
if (_this.is(":checked")) {
|
||||
if (_this.is(":checked") || _this.is(":selected")) {
|
||||
if (_controlleesAreHidden) {
|
||||
_controllees.hide(); // <- unhook this when the following comment applies
|
||||
$(_controllees.show()[0]).find("input").focus(); // <- aaaand a slideDown there...eventually
|
||||
@@ -157,7 +157,7 @@
|
||||
return;
|
||||
}
|
||||
controller.data("isControlling", 1);
|
||||
if (!controller.is(":checked")) {
|
||||
if (!controller.is(":checked") && !controller.is(":selected")) {
|
||||
$("[data-controllerid=" + controller.attr("id") + "]").hide();
|
||||
}
|
||||
if (controller.is(":checkbox")) {
|
||||
@@ -165,6 +165,11 @@
|
||||
} else if (controller.is(":radio")) {
|
||||
$("[name=" + controller.attr("name") + "]").click(function () { $("[name=" + $(this).attr("name") + "]").each($(this).toggleWhatYouControl); });
|
||||
}
|
||||
else if (controller.is("option")) {
|
||||
controller.parent().change(function () {
|
||||
controller.toggleWhatYouControl();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
// inline form link buttons (form.inline.link button) swapped out for a link that submits said form
|
||||
@@ -214,7 +219,7 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
form.submit();
|
||||
return false;
|
||||
});
|
||||
|
Reference in New Issue
Block a user