mirror of
https://github.com/processwire/processwire.git
synced 2025-08-16 11:44:42 +02:00
Remove fieldset management from ProcessTemplate since it is now native to asmSelect
This commit is contained in:
@@ -16,18 +16,6 @@ input[disabled=disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
span.asmFieldsetIndent {
|
||||
float: left;
|
||||
width: 15px;
|
||||
height: 5px;
|
||||
}
|
||||
|
||||
.pw-content .asmFieldset,
|
||||
#content .asmFieldset {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#ProcessTemplateList td:first-child,
|
||||
#ProcessTemplateList td:nth-child(2) {
|
||||
width: 30%;
|
||||
|
@@ -121,36 +121,10 @@ $(document).ready(function() {
|
||||
|
||||
$("#wrap_redirectLogin input").click(redirectLoginClick);
|
||||
|
||||
// -----------------
|
||||
// asmSelect fieldgroup indentation
|
||||
var fieldgroupFieldsChange = function() {
|
||||
$ol = $('#fieldgroup_fields').prev('ol.asmList');
|
||||
$ol.find('span.asmFieldsetIndent').remove();
|
||||
$ol.children('li').children('span.asmListItemLabel').children("a:contains('_END')").each(function() {
|
||||
var label = $(this).text();
|
||||
if(label.substring(label.length-4) != '_END') return;
|
||||
label = label.substring(0, label.length-4);
|
||||
var $li = $(this).parents('li.asmListItem');
|
||||
$li.addClass('asmFieldset asmFieldsetEnd');
|
||||
while(1) {
|
||||
$li = $li.prev('li.asmListItem');
|
||||
if($li.size() < 1) break;
|
||||
var $span = $li.children('span.asmListItemLabel'); // .children('a');
|
||||
var label2 = $span.text();
|
||||
if(label2 == label) {
|
||||
$li.addClass('asmFieldset asmFieldsetStart');
|
||||
break;
|
||||
}
|
||||
$span.prepend($('<span class="asmFieldsetIndent"></span>'));
|
||||
}
|
||||
});
|
||||
};
|
||||
$("#fieldgroup_fields").change(fieldgroupFieldsChange).bind('init', fieldgroupFieldsChange);
|
||||
|
||||
adjustAccessFields();
|
||||
redirectLoginClick();
|
||||
|
||||
// instantiate the WireTabs
|
||||
// instantiate the WireTabs
|
||||
var $templateEdit = $("#ProcessTemplateEdit");
|
||||
if($templateEdit.length > 0) {
|
||||
$templateEdit.find('script').remove();
|
||||
|
@@ -1 +1 @@
|
||||
$(document).ready(function(){$("#wrap_filter_system input").click(function(){$(this).parents("form").submit()});$("#filter_field").change(function(){$(this).parents("form").submit()});var a=function(){if($("#redirectLogin_-1:checked").size()>0){$("#wrap_redirectLoginURL").slideDown()}else{$("#wrap_redirectLoginURL").hide()}};var f=function(){var g=["#wrap_redirectLogin","#wrap_guestSearchable"];if($("#roles_37").is(":checked")){$("#wrap_redirectLoginURL").hide();$(g).each(function(i,j){var h=$(j);if(h.is(".InputfieldStateCollapsed")){h.hide()}else{h.slideUp()}});$("input.viewRoles").attr("checked","checked")}else{$(g).each(function(i,j){var h=$(j);if(h.is(":visible")){return}h.slideDown("fast",function(){if(!h.is(".InputfieldStateCollapsed")){return}h.find(".InputfieldStateToggle").click()})});a()}};$("#wrap_useRoles input").click(function(){if($("#useRoles_1:checked").size()>0){$("#wrap_redirectLogin").hide();$("#wrap_guestSearchable").hide();$("#useRolesYes").slideDown();$("#wrap_useRoles > label").click();$("input.viewRoles").attr("checked","checked")}else{$("#useRolesYes").slideUp();$("#accessOverrides:visible").slideUp()}});if($("#useRoles_0:checked").size()>0){$("#useRolesYes").hide();$("#accessOverrides").hide()}$("#roles_37").click(f);$("input.viewRoles:not(#roles_37)").click(function(){var g=$(this);if($("#roles_37").is(":checked")){return false}return true});var d=function(){var h=$("#roles_editor input.editRoles");var g=0;h.each(function(){var j=$(this);if(j.is(":disabled")){return false}var i=$("input.createRoles[value="+j.attr("value")+"]");if(j.is(":checked")){g++;i.removeAttr("disabled")}else{i.removeAttr("checked").attr("disabled","disabled")}});if(g){$("#accessOverrides").slideDown()}else{$("#accessOverrides").hide()}return true};var e=function(){var g=0;$("#roles_editor input.editRoles").each(function(){if(!$(this).is(":disabled")&&$(this).is(":checked")){g++}});$("#roles_editor input.addRoles").each(function(){if(!$(this).is(":disabled")&&$(this).is(":checked")){g++}});g>0?$("#wrap_noInherit").slideDown():$("#wrap_noInherit").hide()};$("#roles_editor input.editRoles").click(d);$("#roles_editor input.editRoles, #roles_editor input.addRoles").click(e);d();e();$("#wrap_redirectLogin input").click(a);var c=function(){$ol=$("#fieldgroup_fields").prev("ol.asmList");$ol.find("span.asmFieldsetIndent").remove();$ol.children("li").children("span.asmListItemLabel").children("a:contains('_END')").each(function(){var h=$(this).text();if(h.substring(h.length-4)!="_END"){return}h=h.substring(0,h.length-4);var j=$(this).parents("li.asmListItem");j.addClass("asmFieldset asmFieldsetEnd");while(1){j=j.prev("li.asmListItem");if(j.size()<1){break}var g=j.children("span.asmListItemLabel");var i=g.text();if(i==h){j.addClass("asmFieldset asmFieldsetStart");break}g.prepend($('<span class="asmFieldsetIndent"></span>'))}})};$("#fieldgroup_fields").change(c).bind("init",c);f();a();var b=$("#ProcessTemplateEdit");if(b.length>0){b.find("script").remove();b.WireTabs({items:$(".Inputfields li.WireTab"),id:"TemplateEditTabs",skipRememberTabIDs:["WireTabDelete"]})}$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var g=$(this).parents("p.import_toggle").next("table");var h=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){g.hide();h.addClass("ui-priority-secondary")}else{g.show();h.removeClass("ui-priority-secondary")}}).change();$("#import_form table td:not(:first-child)").each(function(){var g=$(this).html();var h=false;if(g.substring(0,1)=="{"){g="<pre>"+g+"</pre>";g=g.replace(/<br>/g,"");h=true}if(h){$(this).html(g)}});$("#fieldgroup_fields").change(function(){$("#_fieldgroup_fields_changed").val("changed")})});
|
||||
$(document).ready(function(){$("#wrap_filter_system input").click(function(){$(this).parents("form").submit()});$("#filter_field").change(function(){$(this).parents("form").submit()});var a=function(){if($("#redirectLogin_-1:checked").size()>0){$("#wrap_redirectLoginURL").slideDown()}else{$("#wrap_redirectLoginURL").hide()}};var e=function(){var f=["#wrap_redirectLogin","#wrap_guestSearchable"];if($("#roles_37").is(":checked")){$("#wrap_redirectLoginURL").hide();$(f).each(function(h,i){var g=$(i);if(g.is(".InputfieldStateCollapsed")){g.hide()}else{g.slideUp()}});$("input.viewRoles").attr("checked","checked")}else{$(f).each(function(h,i){var g=$(i);if(g.is(":visible")){return}g.slideDown("fast",function(){if(!g.is(".InputfieldStateCollapsed")){return}g.find(".InputfieldStateToggle").click()})});a()}};$("#wrap_useRoles input").click(function(){if($("#useRoles_1:checked").size()>0){$("#wrap_redirectLogin").hide();$("#wrap_guestSearchable").hide();$("#useRolesYes").slideDown();$("#wrap_useRoles > label").click();$("input.viewRoles").attr("checked","checked")}else{$("#useRolesYes").slideUp();$("#accessOverrides:visible").slideUp()}});if($("#useRoles_0:checked").size()>0){$("#useRolesYes").hide();$("#accessOverrides").hide()}$("#roles_37").click(e);$("input.viewRoles:not(#roles_37)").click(function(){var f=$(this);if($("#roles_37").is(":checked")){return false}return true});var c=function(){var g=$("#roles_editor input.editRoles");var f=0;g.each(function(){var i=$(this);if(i.is(":disabled")){return false}var h=$("input.createRoles[value="+i.attr("value")+"]");if(i.is(":checked")){f++;h.removeAttr("disabled")}else{h.removeAttr("checked").attr("disabled","disabled")}});if(f){$("#accessOverrides").slideDown()}else{$("#accessOverrides").hide()}return true};var d=function(){var f=0;$("#roles_editor input.editRoles").each(function(){if(!$(this).is(":disabled")&&$(this).is(":checked")){f++}});$("#roles_editor input.addRoles").each(function(){if(!$(this).is(":disabled")&&$(this).is(":checked")){f++}});f>0?$("#wrap_noInherit").slideDown():$("#wrap_noInherit").hide()};$("#roles_editor input.editRoles").click(c);$("#roles_editor input.editRoles, #roles_editor input.addRoles").click(d);c();d();$("#wrap_redirectLogin input").click(a);e();a();var b=$("#ProcessTemplateEdit");if(b.length>0){b.find("script").remove();b.WireTabs({items:$(".Inputfields li.WireTab"),id:"TemplateEditTabs",skipRememberTabIDs:["WireTabDelete"]})}$("#export_data").click(function(){$(this).select()});$(".import_toggle input[type=radio]").change(function(){var f=$(this).parents("p.import_toggle").next("table");var g=$(this).closest(".InputfieldFieldset");if($(this).is(":checked")&&$(this).val()==0){f.hide();g.addClass("ui-priority-secondary")}else{f.show();g.removeClass("ui-priority-secondary")}}).change();$("#import_form table td:not(:first-child)").each(function(){var f=$(this).html();var g=false;if(f.substring(0,1)=="{"){f="<pre>"+f+"</pre>";f=f.replace(/<br>/g,"");g=true}if(g){$(this).html(f)}});$("#fieldgroup_fields").change(function(){$("#_fieldgroup_fields_changed").val("changed")})});
|
@@ -936,7 +936,8 @@ class ProcessTemplate extends Process {
|
||||
$select->attr('id', 'fieldgroup_fields');
|
||||
$select->attr('title', $this->_('Add Field'));
|
||||
$select->attr('data-closeAddLabel', $this->_('Close and Add'));
|
||||
$select->setAsmSelectOption('sortable', true);
|
||||
$select->setAsmSelectOption('sortable', true);
|
||||
$select->setAsmSelectOption('fieldset', true);
|
||||
$select->setAsmSelectOption('editLink', $this->wire('config')->urls->admin . "setup/field/edit?id={value}&fieldgroup_id={$template->fieldgroup->id}&modal=1&process_template=1");
|
||||
$select->setAsmSelectOption('hideDeleted', false);
|
||||
|
||||
|
Reference in New Issue
Block a user