fixed includeJS causing jQuery to be included twice and breaking plugins

This commit is contained in:
Ralf Becker 2021-06-08 15:11:37 +02:00
parent 304dbb95ab
commit 8fa2bb466b
6 changed files with 14 additions and 10 deletions

View File

@ -18,6 +18,7 @@ import { ClassWithAttributes } from "./et2_core_inheritance";
import { et2_evalBool, et2_no_init } from "./et2_core_common";
import { et2_url } from "./et2_widget_url";
import { egw } from "../jsapi/egw_global";
import "../../../vendor/egroupware/magicsuggest/magicsuggest.js";
/**
* Tag list widget
*

View File

@ -21,6 +21,7 @@ import {et2_IResizeable} from "./et2_core_interfaces";
import {et2_evalBool, et2_no_init} from "./et2_core_common";
import {et2_url} from "./et2_widget_url";
import {egw} from "../jsapi/egw_global";
import "../../../vendor/egroupware/magicsuggest/magicsuggest.js";
/**
* Tag list widget

View File

@ -5,6 +5,8 @@
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com
import 'jquery';
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `grunt build`, do not edit it by hand.
(function() {
@ -113,7 +115,7 @@
this.SelectParser = SelectParser;
}).call(this);
}).call(window);
(function() {
var AbstractChosen, root;
@ -458,9 +460,9 @@
root.AbstractChosen = AbstractChosen;
}).call(this);
}).call(window);
(function() {
(function(jQuery) {
var $, Chosen, root, _ref,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
@ -802,7 +804,7 @@
chosen: this
});
var windowHeight = $(window).height(),
dropdownTop = this.container.offset().top + this.container.height() - $(window).scrollTop()
dropdownTop = this.container.offset().top + this.container.height() - $(window).scrollTop(),
totalHeight = this.dropdown.height() + dropdownTop
this.dropdown.toggleClass('chzn-above', totalHeight > windowHeight);
@ -1211,4 +1213,4 @@
root.Chosen = Chosen;
}).call(this);
}).call(window, jQuery);

View File

@ -156,7 +156,7 @@ egw.extend('files', egw.MODULE_WND_LOCAL, function(_app, _wnd)
{
_jsFiles = [_jsFiles];
}
const promise = import(_prefix ? _jsFiles.map((src) => _prefix+src) : _jsFiles);
const promise = Promise.all(_jsFiles.map((src) => import(_prefix ? _prefix+src : src)));
return typeof _callback === 'undefined' ? promise : promise.then(_callback.call(_context));
// @todo check the prefix stuff

View File

@ -1,15 +1,16 @@
/**
* EGroupware: Stylite Pixelegg template: hiding/showing header
* EGroupware: Pixelegg template: hiding/showing header
*
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @author Wolfgang Ott <wolfgang.ott@pixelegg.de>
* @package pixelegg
* @version $Id: class.pixelegg_framework.inc.php 2741 2013-11-14 13:53:24Z ralfbecker $
*/
egw_LAB.wait(function() {
import '../../api/js/jquery/chosen/chosen.jquery.js';
egw_ready.then(function()
{
/**
* replace [+] on mouseover with quick-add selectbox
*

View File

@ -17,7 +17,6 @@ import 'jqueryui';
import '../../api/js/jsapi/egw_global';
import {EgwApp} from '../../api/js/jsapi/egw_app';
import {etemplate2} from "../../api/js/etemplate/etemplate2";
/**
* UI for timesheet