mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-09-29 20:59:05 +02:00
API respect custom attributes on OptionsetField and CheckboxSetField
Must be merged with https://github.com/silverstripe/silverstripe-framework/pull/4390
This commit is contained in:
parent
e45ef93aa7
commit
a6677b1653
@ -15,7 +15,7 @@ addons:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- CORE_RELEASE=3
|
- CORE_RELEASE=3.2
|
||||||
- "ARTIFACTS_AWS_REGION=us-east-1"
|
- "ARTIFACTS_AWS_REGION=us-east-1"
|
||||||
- "ARTIFACTS_S3_BUCKET=silverstripe-travis-artifacts"
|
- "ARTIFACTS_S3_BUCKET=silverstripe-travis-artifacts"
|
||||||
- secure: "7V20Qk3bIG2AlTJaA5D/uzB8vUVvRwQp+xjRYUxlahtj9FcuqEV3HIyjwwJe0T6Z1bnRYuu28ZnCT2CfP9BBZ3FE7AwSZbPase9c0/at2qDJNqkvIdC1xZ1H6Fcy2LSwNB9wLQPe613ItVdanitEuwE41iowxBPslxUUTnwx7eY="
|
- secure: "7V20Qk3bIG2AlTJaA5D/uzB8vUVvRwQp+xjRYUxlahtj9FcuqEV3HIyjwwJe0T6Z1bnRYuu28ZnCT2CfP9BBZ3FE7AwSZbPase9c0/at2qDJNqkvIdC1xZ1H6Fcy2LSwNB9wLQPe613ItVdanitEuwE41iowxBPslxUUTnwx7eY="
|
||||||
|
@ -108,7 +108,7 @@
|
|||||||
updateSelectionFilter: function(disallowedChildren, defaultChildClass) {
|
updateSelectionFilter: function(disallowedChildren, defaultChildClass) {
|
||||||
// Limit selection
|
// Limit selection
|
||||||
var allAllowed = null; // troolian
|
var allAllowed = null; // troolian
|
||||||
this.find('#Form_AddForm_PageType_Holder li').each(function() {
|
this.find('#Form_AddForm_PageType li').each(function() {
|
||||||
var className = $(this).find('input').val(),
|
var className = $(this).find('input').val(),
|
||||||
isAllowed = ($.inArray(className, disallowedChildren) === -1);
|
isAllowed = ($.inArray(className, disallowedChildren) === -1);
|
||||||
|
|
||||||
@ -121,16 +121,16 @@
|
|||||||
// Set default child selection, or fall back to first available option
|
// Set default child selection, or fall back to first available option
|
||||||
if(defaultChildClass) {
|
if(defaultChildClass) {
|
||||||
var selectedEl = this
|
var selectedEl = this
|
||||||
.find('#Form_AddForm_PageType_Holder li input[value=' + defaultChildClass + ']')
|
.find('#Form_AddForm_PageType li input[value=' + defaultChildClass + ']')
|
||||||
.parents('li:first');
|
.parents('li:first');
|
||||||
} else {
|
} else {
|
||||||
var selectedEl = this.find('#Form_AddForm_PageType_Holder li:not(.disabled):first');
|
var selectedEl = this.find('#Form_AddForm_PageType li:not(.disabled):first');
|
||||||
}
|
}
|
||||||
selectedEl.setSelected(true);
|
selectedEl.setSelected(true);
|
||||||
selectedEl.siblings().setSelected(false);
|
selectedEl.siblings().setSelected(false);
|
||||||
|
|
||||||
// Disable the "Create" button if none of the pagetypes are available
|
// Disable the "Create" button if none of the pagetypes are available
|
||||||
var buttonState = this.find('#Form_AddForm_PageType_Holder li:not(.disabled)').length
|
var buttonState = this.find('#Form_AddForm_PageType li:not(.disabled)').length
|
||||||
? 'enable'
|
? 'enable'
|
||||||
: 'disable';
|
: 'disable';
|
||||||
this.find('button[name=action_doAdd]').button(buttonState);
|
this.find('button[name=action_doAdd]').button(buttonState);
|
||||||
@ -139,7 +139,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".cms-add-form #Form_AddForm_PageType_Holder li").entwine({
|
$(".cms-add-form #Form_AddForm_PageType li").entwine({
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
this.setSelected(true);
|
this.setSelected(true);
|
||||||
},
|
},
|
||||||
|
@ -59,7 +59,7 @@ Feature: Insert an image into a page
|
|||||||
Given I press the "Insert Media" button
|
Given I press the "Insert Media" button
|
||||||
And I press the "From the CMS" button
|
And I press the "From the CMS" button
|
||||||
And I fill in the "ParentID" dropdown with "folder1"
|
And I fill in the "ParentID" dropdown with "folder1"
|
||||||
And I click on "file1.jpg" in the "Files" table
|
And I click on "file1" in the "Files" table
|
||||||
When I press the "Insert" button
|
When I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "file1.jpg"
|
Then the "Content" HTML field should contain "file1.jpg"
|
||||||
# Required to avoid "unsaved changed" browser dialog
|
# Required to avoid "unsaved changed" browser dialog
|
||||||
@ -69,7 +69,7 @@ Feature: Insert an image into a page
|
|||||||
Given I press the "Insert Media" button
|
Given I press the "Insert Media" button
|
||||||
And I press the "From the CMS" button
|
And I press the "From the CMS" button
|
||||||
And I fill in the "ParentID" dropdown with "folder1"
|
And I fill in the "ParentID" dropdown with "folder1"
|
||||||
And I click on "file1.jpg" in the "Files" table
|
And I click on "file1" in the "Files" table
|
||||||
And I press the "Edit" button
|
And I press the "Edit" button
|
||||||
When I fill in "Alternative text (alt)" with "My alt"
|
When I fill in "Alternative text (alt)" with "My alt"
|
||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
|
Loading…
Reference in New Issue
Block a user