mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
ef4d539a12
Fixed a few missed strict errors Applied patch from kmayo to fix issues with SubsiteAdminTest.php Fixed issue causing the url segments of subsites created from a template to add -2 to the end Fixed undefined method TotalItems() on datalist for the SubsiteTest Fixed failure on SubsiteTest because DataObject::get_one() now returns boolean false instead of null when no result is found Fixed failure on SubsitesVirtualPageTest caused by Versioned::get_one_by_stage() returning null instead of false Fixed failure caused by the contact-us page existing on subsite 2 Merged another patch from kmayo Force main site to be on, for some reason it gets hidden in some cases i.e. refreshing the cms while editing a page
52 lines
1.4 KiB
JavaScript
52 lines
1.4 KiB
JavaScript
(function($) {
|
|
$.entwine('ss', function($) {
|
|
$('#SubsitesSelect').live('change', function() {
|
|
window.location.search=$.query.set('SubsiteID', $(this).val());
|
|
});
|
|
|
|
// Subsite tab of Group editor
|
|
$('#Form_ItemEditForm_AccessAllSubsites').entwine({
|
|
/**
|
|
* Constructor: onmatch
|
|
*/
|
|
onmatch: function () {
|
|
this.showHideSubsiteList();
|
|
|
|
var ref=this;
|
|
$('#Form_ItemEditForm_AccessAllSubsites input').change(function() {
|
|
ref.showHideSubsiteList();
|
|
});
|
|
},
|
|
|
|
showHideSubsiteList: function () {
|
|
$('#Form_ItemEditForm_Subsites').parent().parent().css('display', ($('#Form_ItemEditForm_AccessAllSubsites_1').is(':checked') ? 'none':''));
|
|
}
|
|
});
|
|
|
|
$('.cms-edit-form').entwine({
|
|
getChangeTrackerOptions: function() {
|
|
this.ChangeTrackerOptions.ignoreFieldSelector+=', input[name=IsSubsite]';
|
|
}
|
|
});
|
|
|
|
/**
|
|
* Binding a visibility toggle anchor to a longer list of checkboxes.
|
|
* Hidden by default, unless either the toggle checkbox, or any of the
|
|
* actual value checkboxes are selected.
|
|
*/
|
|
$('#PageTypeBlacklist').entwine({
|
|
onmatch: function() {
|
|
var hasLimits=Boolean($('#PageTypeBlacklist').find('input:checked').length);
|
|
jQuery('#PageTypeBlacklist').toggle(hasLimits);
|
|
|
|
|
|
//Bind listener
|
|
$('a#PageTypeBlacklistToggle').click(function(e) {
|
|
jQuery('#PageTypeBlacklist').toggle();
|
|
e.stopPropagation();
|
|
return false;
|
|
});
|
|
}
|
|
});
|
|
});
|
|
})(jQuery); |