| @@ -49880,9 +49880,19 @@ | ||
| 49880 | 49880 | id: "elementor-panel-elements", |
| 49881 | 49881 | className: "elementor-responsive-panel", |
| 49882 | 49882 | initialize: function initialize() { |
| 49883 | 49883 | this.listenTo(elementor.channels.panelElements, "filter:change", this.onFilterChanged); |
| 49884 | + this._syncAtomicComparator(); | |
| 49884 | 49885 | }, |
| 49886 | + _syncAtomicComparator: function _syncAtomicComparator() { | |
| 49887 | + var _elementorCommon$conf; | |
| 49888 | + if (elementor.channels.panelElements.request("filter:value") && (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) !== null && _elementorCommon$conf !== void 0 && _elementorCommon$conf.e_atomic_elements) this.viewComparator = function(a, b) { | |
| 49889 | + if (a.get("atomic") && !b.get("atomic")) return -1; | |
| 49890 | + if (!a.get("atomic") && b.get("atomic")) return 1; | |
| 49891 | + return 0; | |
| 49892 | + }; | |
| 49893 | + else this.viewComparator = null; | |
| 49894 | + }, | |
| 49885 | 49895 | filter: function filter(childModel) { |
| 49886 | 49896 | var filterValue = elementor.channels.panelElements.request("filter:value"); |
| 49887 | 49897 | if (!filterValue) return true; |
| 49888 | 49898 | if (childModel.get("hideOnSearch")) return false; |
| @@ -49895,9 +49905,11 @@ | ||
| 49895 | 49905 | return regularFilter || localizedFilter; |
| 49896 | 49906 | }); |
| 49897 | 49907 | }, |
| 49898 | 49908 | onFilterChanged: function onFilterChanged() { |
| 49899 | - if (!elementor.channels.panelElements.request("filter:value")) this.onFilterEmpty(); | |
| 49909 | + var filterValue = elementor.channels.panelElements.request("filter:value"); | |
| 49910 | + this._syncAtomicComparator(); | |
| 49911 | + if (!filterValue) this.onFilterEmpty(); | |
| 49900 | 49912 | this._renderChildren(); |
| 49901 | 49913 | this.triggerMethod("children:render"); |
| 49902 | 49914 | }, |
| 49903 | 49915 | onFilterEmpty: function onFilterEmpty() { |
| @@ -52604,9 +52616,10 @@ | ||
| 52604 | 52616 | widgetType: item.widget_type, |
| 52605 | 52617 | custom: item.custom, |
| 52606 | 52618 | editable: item.editable, |
| 52607 | 52619 | hideOnSearch: item.hide_on_search, |
| 52608 | - isNew: this.isWidgetNew(item) | |
| 52620 | + isNew: this.isWidgetNew(item), | |
| 52621 | + atomic: !!item.atomic | |
| 52609 | 52622 | }; |
| 52610 | 52623 | }, |
| 52611 | 52624 | initCategoriesCollection: function initCategoriesCollection() { |
| 52612 | 52625 | var categories = {}; |