From a6677b1653cf338d66b8b6d1e4d5b14d66250c0e Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 10 Jul 2015 14:53:17 +1200 Subject: [PATCH] API respect custom attributes on OptionsetField and CheckboxSetField Must be merged with https://github.com/silverstripe/silverstripe-framework/pull/4390 --- .travis.yml | 2 +- javascript/CMSMain.AddForm.js | 10 +++++----- tests/behat/features/insert-an-image.feature | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index cbe0f141..cb57f992 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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=" diff --git a/javascript/CMSMain.AddForm.js b/javascript/CMSMain.AddForm.js index 00605888..778b9483 100644 --- a/javascript/CMSMain.AddForm.js +++ b/javascript/CMSMain.AddForm.js @@ -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); }, diff --git a/tests/behat/features/insert-an-image.feature b/tests/behat/features/insert-an-image.feature index bc1883e9..f4b48080 100644 --- a/tests/behat/features/insert-an-image.feature +++ b/tests/behat/features/insert-an-image.feature @@ -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