diff --git a/modules/backend/widgets/reportcontainer/assets/js/reportcontainer.js b/modules/backend/widgets/reportcontainer/assets/js/reportcontainer.js index ad08f9a7b..ec580a581 100644 --- a/modules/backend/widgets/reportcontainer/assets/js/reportcontainer.js +++ b/modules/backend/widgets/reportcontainer/assets/js/reportcontainer.js @@ -19,6 +19,7 @@ this.options = options this.$el= $(element) this.$form = this.$el.closest('form') + this.$toolbar = $('[data-container-toolbar]', this.$form) this.alias = $('[data-container-alias]', this.$form).val() this.init(); @@ -40,7 +41,7 @@ $(window).resize($.proxy(this.updateWidth, this)) this.updateWidth() - if (!Modernizr.touch) + if (!Modernizr.touch) { this.$el.sortable({ vertical: false, handle: '.drag-handle', @@ -53,6 +54,7 @@ self.postSortOrders() } }) + } this.$el.on('hidden.oc.inspector', '[data-inspectable]', function() { var values = $('[data-inspector-values]', this).val(), @@ -126,7 +128,11 @@ .isotope('reloadItems') .isotope({ sortBy: 'original-order' }) - $('li.item', this.$el).css({'width': '', 'height': ''}) + var $items = $('li.item', this.$el) + + $items.css({'width': '', 'height': ''}) + + $('> .dropdown', this.$toolbar).toggleClass('dropup', !!$items.length) } ReportContainer.prototype.setSortOrders = function() { diff --git a/modules/backend/widgets/reportcontainer/partials/_container.htm b/modules/backend/widgets/reportcontainer/partials/_container.htm index 4e67b37cf..d4f75a0bf 100644 --- a/modules/backend/widgets/reportcontainer/partials/_container.htm +++ b/modules/backend/widgets/reportcontainer/partials/_container.htm @@ -9,6 +9,8 @@ canAddAndDelete): ?> - = $this->makePartial('widget_toolbar') ?> +