diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 23:28:43 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-28 23:28:43 +0300 |
commit | a2f375e8f74870dcdcfa1c7886bd1c14c80a684e (patch) | |
tree | 6b6e3a4f7554f4671edc17d87869dd6916984404 /app/assets/javascripts/main.js | |
parent | a22f6fa6e50bb31921415b01fd345d6802581390 (diff) | |
parent | 81852d1f902c2923c239e9c33cab77f5fd6ca8d8 (diff) |
Merge remote-tracking branch 'origin/master' into object-storage-ee-to-ce-backport
Diffstat (limited to 'app/assets/javascripts/main.js')
-rw-r--r-- | app/assets/javascripts/main.js | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js index b99cb257ce3..659dc9eaa1f 100644 --- a/app/assets/javascripts/main.js +++ b/app/assets/javascripts/main.js @@ -10,7 +10,7 @@ window.jQuery = jQuery; window.$ = jQuery; // lib/utils -import { handleLocationHash } from './lib/utils/common_utils'; +import { handleLocationHash, addSelectOnFocusBehaviour } from './lib/utils/common_utils'; import { localTimeAgo } from './lib/utils/datetime_utility'; import { getLocationHash, visitUrl } from './lib/utils/url_utility'; @@ -61,7 +61,7 @@ gl.lazyLoader = new LazyLoader({ observerNode: '#content-body', }); -$(() => { +document.addEventListener('DOMContentLoaded', () => { const $body = $('body'); const $document = $(document); const $window = $(window); @@ -104,13 +104,7 @@ $(() => { return true; }); - // Click a .js-select-on-focus field, select the contents - // Prevent a mouseup event from deselecting the input - $('.js-select-on-focus').on('focusin', function selectOnFocusCallback() { - $(this).select().one('mouseup', (e) => { - e.preventDefault(); - }); - }); + addSelectOnFocusBehaviour('.js-select-on-focus'); $('.remove-row').on('ajax:success', function removeRowAjaxSuccessCallback() { $(this).tooltip('destroy') @@ -220,7 +214,7 @@ $(() => { $document.on('click', '.js-confirm-danger', (e) => { const btn = $(e.target); const form = btn.closest('form'); - const text = btn.data('confirm-danger-message'); + const text = btn.data('confirmDangerMessage'); e.preventDefault(); // eslint-disable-next-line no-new |