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:
Damian Mooyman 2015-07-10 14:53:17 +12:00
parent e45ef93aa7
commit a6677b1653
3 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@ addons:
env:
global:
- CORE_RELEASE=3
- CORE_RELEASE=3.2
- "ARTIFACTS_AWS_REGION=us-east-1"
- "ARTIFACTS_S3_BUCKET=silverstripe-travis-artifacts"
- secure: "7V20Qk3bIG2AlTJaA5D/uzB8vUVvRwQp+xjRYUxlahtj9FcuqEV3HIyjwwJe0T6Z1bnRYuu28ZnCT2CfP9BBZ3FE7AwSZbPase9c0/at2qDJNqkvIdC1xZ1H6Fcy2LSwNB9wLQPe613ItVdanitEuwE41iowxBPslxUUTnwx7eY="

View File

@ -108,7 +108,7 @@
updateSelectionFilter: function(disallowedChildren, defaultChildClass) {
// Limit selection
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(),
isAllowed = ($.inArray(className, disallowedChildren) === -1);
@ -121,16 +121,16 @@
// Set default child selection, or fall back to first available option
if(defaultChildClass) {
var selectedEl = this
.find('#Form_AddForm_PageType_Holder li input[value=' + defaultChildClass + ']')
.find('#Form_AddForm_PageType li input[value=' + defaultChildClass + ']')
.parents('li:first');
} 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.siblings().setSelected(false);
// 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'
: 'disable';
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) {
this.setSelected(true);
},

View File

@ -59,7 +59,7 @@ Feature: Insert an image into a page
Given I press the "Insert Media" button
And I press the "From the CMS" button
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
Then the "Content" HTML field should contain "file1.jpg"
# 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
And I press the "From the CMS" button
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
When I fill in "Alternative text (alt)" with "My alt"
And I press the "Insert" button