diff --git a/app/assets/javascripts/templateFolderForm.js b/app/assets/javascripts/templateFolderForm.js index 01cc8bab3..b6668d19a 100644 --- a/app/assets/javascripts/templateFolderForm.js +++ b/app/assets/javascripts/templateFolderForm.js @@ -29,6 +29,9 @@ this.states.filter(state => state.cancellable).forEach((x) => this.addCancelButton(x)); this.states.filter(state => state.key === 'items-selected-buttons').forEach(x => this.addClearButton(x)); + // activate stickiness of elements in each state + this.activateStickyElements(); + // first off show the new template / new folder buttons this.currentState = this.$form.data('prev-state') || 'unknown'; if (this.currentState === 'unknown') { @@ -41,6 +44,18 @@ this.$form.on('change', 'input[type=checkbox]', () => this.templateFolderCheckboxChanged()); }; + this.activateStickyElements = function() { + var oldClass = '.js-will-stick-at-bottom-when-scrolling'; + var newClass = 'js-stick-at-bottom-when-scrolling'; + + this.states.forEach(state => { + state.$el + .find(oldClass) + .removeClass(oldClass) + .addClass(newClass); + }); + }; + this.addCancelButton = function(state) { let $cancel = this.makeButton('Cancel', () => { diff --git a/app/templates/views/templates/_move_to.html b/app/templates/views/templates/_move_to.html index cf752d9b8..c08713bdf 100644 --- a/app/templates/views/templates/_move_to.html +++ b/app/templates/views/templates/_move_to.html @@ -6,14 +6,14 @@ {% if templates_and_folders_form.move_to.choices and template_list.templates_to_show %}