Hiding the content picker field select control #12540
Replies: 2 comments
-
My proof of concept .js fix was to put this at the end of vue-multiselect-wrapper.js's onSelect function:
and this to the end of its remove function:
|
Beta Was this translation helpful? Give feedback.
-
The above Javascript covers what you see in the examples above but you also need to cover what happens when you initially load the item, which I did in ContentPickerField.Edit.cshtml. At the top of the file in the code block:
And then in the
This basically sets the same style we set in the Javascript but done for the initial load from C#. Maybe better to just do it all in Javascript but this was just my POC... |
Beta Was this translation helpful? Give feedback.
-
If you are using the content picker field, and set "multiple" to false, there doesn't seem to be any need to show the search/select list control once you've selected a content item. Of course if you delete the content item, you need to show it again but while a content item is selected, the search/select list control is currently shown disabled under the selected content item. I feel like it is a weird UI where the space taken up by this field doubles and halves when you select/delete content which moves the following controls up and down. It also takes up twice the vertical space it needs to, adds to clutter on the admin pages, and would just be much nicer if it was hidden. The same issue exists for the user picker field (and perhaps other things).
Here is the issue:
And here is how it looks fixed:
I wasn't sure where to put this as it isn't really a bug and seems too small to be considered a "feature request." I became obsessed with this last night and somehow managed to get some working code that does what I want, though I suspect it is not the best code/approach and currently only works if I edit the generated .js file for vue-multiselect-wrapper.js. I'm still pretty new to Orchard, am not great w/Javascript and jQuery, and have never used vue or gulp... but thought perhaps one of the gurus could take what I've done and clean it up to do it right. I'm happy to help if I can if there is interest in making this change.
Beta Was this translation helpful? Give feedback.
All reactions