Skip to content

Commit

Permalink
[5.x] Live Preview: Allow changing the position of "Responsive" devic…
Browse files Browse the repository at this point in the history
…e option (#11404)
  • Loading branch information
duncanmcclean authored Jan 29, 2025
1 parent 863d82d commit 37fe836
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion resources/js/components/live-preview/LivePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,17 @@ export default {
deviceSelectOptions() {
let options = Object.values(_.mapObject(this.$config.get('livePreview.devices'), (dimensions, device) => {
if (device === 'Responsive') {
return { value: null, label: __('Responsive') };
}
return { value: device, label: __(device) };
}));
options.unshift({ value: null, label: __('Responsive') });
if (options.filter((option) => option.label === __('Responsive')).length === 0) {
options.unshift({ value: null, label: __('Responsive') });
}
return options;
},
Expand Down Expand Up @@ -217,6 +225,7 @@ export default {
},
created() {
this.previewDevice = this.deviceSelectOptions[0].value;
this.editorWidth = localStorage.getItem(widthLocalStorageKey) || 400
this.keybinding = this.$keys.bindGlobal('mod+shift+p', () => {
Expand Down

0 comments on commit 37fe836

Please sign in to comment.