From 53582a46c4a322920d20d411f13c8ba61ab7a136 Mon Sep 17 00:00:00 2001 From: "Karel.Picman" Date: Thu, 17 Mar 2022 14:29:30 +0100 Subject: [PATCH] #1340 late_javascript_tag --- app/helpers/dmsf_helper.rb | 2 +- assets/javascripts/attachments_dmsf.js | 14 +++++++--- .../20220317100901_add_patch_version.rb | 28 +++++++++++++++++++ 3 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20220317100901_add_patch_version.rb diff --git a/app/helpers/dmsf_helper.rb b/app/helpers/dmsf_helper.rb index b5326465..af038a28 100644 --- a/app/helpers/dmsf_helper.rb +++ b/app/helpers/dmsf_helper.rb @@ -30,7 +30,7 @@ module DmsfHelper unless Redmine::Plugin.installed?(:easy_extensions) def late_javascript_tag(content_or_options_with_block = nil, html_options = {}, &block) - javascript_tag content_or_options_with_block, html_options + javascript_tag content_or_options_with_block, html_options, &block end end diff --git a/assets/javascripts/attachments_dmsf.js b/assets/javascripts/attachments_dmsf.js index ed1d2c2e..76f4fe9b 100644 --- a/assets/javascripts/attachments_dmsf.js +++ b/assets/javascripts/attachments_dmsf.js @@ -287,8 +287,14 @@ function dmsfSetupFileDrop() { } } -EASY.schedule.late(function () { - dmsfSetupFileDrop(); - $(document).on("erui_new_dom", dmsfSetupFileDrop); -}); +if(typeof EASY == "undefined"){ + $(document).ready(dmsfSetupFileDrop); +} +else { + EASY.schedule.late(function () { + dmsfSetupFileDrop(); + $(document).on("erui_new_dom", dmsfSetupFileDrop); + }); +} + diff --git a/db/migrate/20220317100901_add_patch_version.rb b/db/migrate/20220317100901_add_patch_version.rb new file mode 100644 index 00000000..ef6d5067 --- /dev/null +++ b/db/migrate/20220317100901_add_patch_version.rb @@ -0,0 +1,28 @@ +# encoding: utf-8 +# +# Redmine plugin for Document Management System "Features" +# +# Copyright © 2011-22 Karel Pičman +# Copyright © 2016-17 carlolars +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +class AddOwnerToDmsfLock < ActiveRecord::Migration[5.2] + + def change + add_column :dmsf_locks, :owner, :string, null: true + end + +end \ No newline at end of file