diff --git a/app/assets/javascripts/templateFolderForm.js b/app/assets/javascripts/templateFolderForm.js index b6668d19a..dcd91a5a1 100644 --- a/app/assets/javascripts/templateFolderForm.js +++ b/app/assets/javascripts/templateFolderForm.js @@ -17,12 +17,12 @@ // all the diff states that we want to show or hide this.states = [ - {key: 'nothing-selected-buttons', $el: this.$form.find('#nothing_selected'), cancellable: false, isStickyGroup: false}, - {key: 'items-selected-buttons', $el: this.$form.find('#items_selected'), cancellable: false, isStickyGroup: false}, - {key: 'move-to-existing-folder', $el: this.$form.find('#move_to_folder_radios'), cancellable: true, isStickyGroup: true}, - {key: 'move-to-new-folder', $el: this.$form.find('#move_to_new_folder_form'), cancellable: true, isStickyGroup: false}, - {key: 'add-new-folder', $el: this.$form.find('#add_new_folder_form'), cancellable: true, isStickyGroup: false}, - {key: 'add-new-template', $el: this.$form.find('#add_new_template_form'), cancellable: true, isStickyGroup: true} + {key: 'nothing-selected-buttons', $el: this.$form.find('#nothing_selected'), cancellable: false}, + {key: 'items-selected-buttons', $el: this.$form.find('#items_selected'), cancellable: false}, + {key: 'move-to-existing-folder', $el: this.$form.find('#move_to_folder_radios'), cancellable: true}, + {key: 'move-to-new-folder', $el: this.$form.find('#move_to_new_folder_form'), cancellable: true}, + {key: 'add-new-folder', $el: this.$form.find('#add_new_folder_form'), cancellable: true}, + {key: 'add-new-template', $el: this.$form.find('#add_new_template_form'), cancellable: true} ]; // cancel/clear buttons only relevant if JS enabled, so @@ -45,12 +45,12 @@ }; this.activateStickyElements = function() { - var oldClass = '.js-will-stick-at-bottom-when-scrolling'; + 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) + .find('.' + oldClass) .removeClass(oldClass) .addClass(newClass); }); @@ -146,29 +146,29 @@ // make sticky JS recalculate its cache of the element's position // use dialog mode for states which contain more than one form control - if (['move-to-existing-folder', 'add-new-template'].includes(this.currentState)) { - GOVUK.stickAtBottomWhenScrolling.recalculate({ 'mode': 'dialog' }); - } else { - GOVUK.stickAtBottomWhenScrolling.recalculate(); - } + GOVUK.stickAtBottomWhenScrolling.recalculate({ 'mode': 'dialog' }); }; this.nothingSelectedButtons = $(` -
- - -
- Nothing selected +
+
+ + +
+ Nothing selected +
`).get(0); this.itemsSelectedButtons = $(` -
- - -
- 1 selected +
+
+ + +
+ 1 selected +
`).get(0); diff --git a/app/templates/views/templates/_move_to.html b/app/templates/views/templates/_move_to.html index c08713bdf..6291417b4 100644 --- a/app/templates/views/templates/_move_to.html +++ b/app/templates/views/templates/_move_to.html @@ -13,16 +13,16 @@ {{ page_footer('Move', button_name='operation', button_value='move-to-existing-folder') }}
-
-
+
+
Move to a new folder {{ textbox(templates_and_folders_form.move_to_new_folder_name) }} {{ page_footer('Move to a new folder', button_name='operation', button_value='move-to-new-folder') }}
{% endif %} -
-
+
+
Add a new folder {{ textbox(templates_and_folders_form.add_new_folder_name) }} {{ page_footer('New folder', button_name='operation', button_value='add-new-folder') }}