Skip to content

Commit

Permalink
Add double-clicking support to FLD elements
Browse files Browse the repository at this point in the history
Resolves #11277
  • Loading branch information
brandonkelly committed May 19, 2022
1 parent 0541649 commit db8a062
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- Selectize options can now specify searchable `keywords` that won’t be visible in the UI.
- Selectize inputs will now include their options’ values as search keywords.
- Newly-created entries now get placeholder Post Date set on them, so they get sorted appropriately when querying for entries ordered by `postDate`. ([#11272](https://github.com/craftcms/cms/issues/11272))
- Field layout elements within field layout designers now support double-clicking to open their settings slideout. ([#11277](https://github.com/craftcms/cms/discussions/11277))
- The `users/create` command now asks whether the user should be activated when saved.
- Deprecation messages are now consistently referred to as “deprecation warnings” in the control panel.

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/cp.js.map

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions src/web/assets/cp/src/js/FieldLayoutDesigner.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,13 +608,16 @@ Craft.FieldLayoutDesigner.Element = Garnish.Base.extend({
title: Craft.t('app', 'Edit'),
});

this.$editBtn.on('click', () => {
const showSettings = () => {
if (!this.slideout) {
this.createSettings(settingsHtml, isRequired);
} else {
this.slideout.open();
}
});
};

this.$editBtn.on('click', showSettings);
this.$container.on('dblclick', showSettings);
}

this.initUi();
Expand Down

0 comments on commit db8a062

Please sign in to comment.