diff --git a/app/assets/javascripts/my_modules.js b/app/assets/javascripts/my_modules.js index e7ff6fb26..1391caff2 100644 --- a/app/assets/javascripts/my_modules.js +++ b/app/assets/javascripts/my_modules.js @@ -273,7 +273,8 @@ function initTagsSelector() { colorField: 'color', closeOnSelect: true, dynamicCreation: true, - dynamicCreationDelimiter: ',' + dynamicCreationDelimiter: ',', + withoutArrow: true }).on('select2:select', (e) => { var params = e.params.data; var newTag = null; diff --git a/app/assets/javascripts/select2_customization.js b/app/assets/javascripts/select2_customization.js index 212f7a64f..ec428ea4d 100644 --- a/app/assets/javascripts/select2_customization.js +++ b/app/assets/javascripts/select2_customization.js @@ -11,7 +11,7 @@ $.fn.extend({ if (this.next().find('.select2-selection').length > 0) return this; templateSelection = (state, parent) => { if (config.colorField !== undefined) { - parent.css('background',state[config.colorField] || state.element.dataset[config.colorField]) + parent.css('background', state[config.colorField] || state.element.dataset[config.colorField]); } return $('' + (config.customSelection !== undefined ? config.customSelection(state) : state.text) @@ -42,7 +42,9 @@ $.fn.extend({ // Placeholder fix for ajax fields if (config.ajax) { - select2.next().find('.select2-search__field').css('width', 'auto'); + setTimeout(() => { + select2.next().find('.select2-search__field').css('width', 'auto'); + }, 0); } // Check that group select correctly @@ -152,18 +154,18 @@ $.fn.extend({ // unlimited size - var select2 = this.select2({ + select2 = this.select2({ closeOnSelect: config.closeOnSelect || false, multiple: true, ajax: config.ajax, templateSelection: templateSelection, tags: config.dynamicCreation || true, - tokenSeparators: config.dynamicCreationDelimiter || [',', ' '], + tokenSeparators: config.dynamicCreationDelimiter || [',', ' '] }); - // Add dynamic size + // Add dynamic size select2.next().css('width', '100%'); - // unlimited size + // unlimited size if (config.unlimitedSize) { this[0].dataset.unlimitedSize = true; select2.next().find('.select2-selection').css('max-height', 'none'); @@ -171,9 +173,10 @@ $.fn.extend({ } // Create arrow - $('
').appendTo(select2.next()) - .click(() => select2.next().find('.select2-selection').click()); - + if (!(config.withoutArrow)) { + $('
').appendTo(select2.next()) + .click(() => select2.next().find('.select2-selection').click()); + } // select all check this[0].dataset.singleDisplay = config.singleDisplay || false; if (this[0].dataset.selectAll === 'true') { diff --git a/app/assets/stylesheets/select2_customizations.scss b/app/assets/stylesheets/select2_customizations.scss index 772eb1725..b6966bb40 100644 --- a/app/assets/stylesheets/select2_customizations.scss +++ b/app/assets/stylesheets/select2_customizations.scss @@ -193,6 +193,21 @@ } } } + + &.select2-container--disabled{ + cursor:pointer; + .select2-selection{ + border:1px solid transparent; + background: transparent; + cursor:pointer; + &:hover{ + border:1px solid $color-gainsboro; + } + .select2-selection__choice { + cursor:pointer; + } + } + } } @media (min-width: 1200px) { @@ -224,19 +239,4 @@ } } } - - &.select2-container--disabled{ - cursor:pointer; - .select2-selection{ - border:1px solid transparent; - background: transparent; - cursor:pointer; - &:hover{ - border:1px solid $color-gainsboro; - } - .select2-selection__choice { - cursor:pointer; - } - } - } } diff --git a/app/controllers/my_modules_controller.rb b/app/controllers/my_modules_controller.rb index 60ca2ff1b..9d36a672d 100644 --- a/app/controllers/my_modules_controller.rb +++ b/app/controllers/my_modules_controller.rb @@ -170,6 +170,7 @@ class MyModulesController < ApplicationController if saved if description_changed log_activity(:change_module_description) + TinyMceAsset.update_images(@my_module, params[:tiny_mce_images]) end if due_date_changes @@ -187,9 +188,6 @@ class MyModulesController < ApplicationController # rubocop:enable Metrics/BlockNesting log_activity(type_of, @my_module, message_items) end - - if saved and description_changed then - TinyMceAsset.update_images(@my_module, params[:tiny_mce_images]) end end respond_to do |format| diff --git a/app/utilities/protocols_exporter.rb b/app/utilities/protocols_exporter.rb index 01d8528a0..cb402e2dc 100644 --- a/app/utilities/protocols_exporter.rb +++ b/app/utilities/protocols_exporter.rb @@ -1,4 +1,3 @@ -# frozen_string_literal: true require 'zip' diff --git a/app/views/global_activities/index.html.erb b/app/views/global_activities/index.html.erb index 6c69121d2..ec737b9af 100644 --- a/app/views/global_activities/index.html.erb +++ b/app/views/global_activities/index.html.erb @@ -1,4 +1,3 @@ -<<<<<<< HEAD <% provide :head_title, t('nav.label.activities') %>
@@ -37,36 +36,3 @@ <%= javascript_include_tag 'global_activities/index.js' %> <%= javascript_include_tag 'global_activities/side_pane.js' %> -======= -
-
-
-

Global activities

-
- -
-
- Expand All -    - Colapse All -
-
-
- - - - -
-
-
-

list of activities

-
- -
- -
- <%= render "team_selection" %> -
- -
->>>>>>> features/note-section diff --git a/db/schema.rb b/db/schema.rb index 9377ce2a8..6f8091451 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,6 @@ # # It's strongly recommended that you check this file into your version control system. - ActiveRecord::Schema.define(version: 20190410110605) do # These are extensions that must be enabled in order to support this database