mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-08-09 16:35:02 +02:00
Replace all jquery-ui sortable used in fw
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
*/
|
||||
import '../jsapi/egw_inheritance.js';
|
||||
import {et2_IPrint} from "../etemplate/et2_core_interfaces";
|
||||
import "sortablejs/Sortable.min.js";
|
||||
|
||||
window.fw_base = (function(){ "use strict"; return Class.extend(
|
||||
{
|
||||
@ -387,21 +388,24 @@ window.fw_base = (function(){ "use strict"; return Class.extend(
|
||||
// reliable init sidebox, as app.js might initialise earlier
|
||||
if (typeof app[_app.appName] == 'object')
|
||||
{
|
||||
var sidebox = jQuery('#favorite_sidebox_'+_app.appName, this.sidemenuDiv);
|
||||
var sidebox = jQuery('#favorite_sidebox_'+_app.appName, this.sidemenuDiv).getElementsByTagName('ul')[0];
|
||||
var self = this;
|
||||
var currentAppName = _app.appName;
|
||||
// make sidebox
|
||||
sidebox.children().sortable({
|
||||
|
||||
items:'li:not([data-id$="add"])',
|
||||
placeholder:'ui-fav-sortable-placeholder',
|
||||
update: function (event, ui)
|
||||
|
||||
let sortablejs = Sortable.create(sidebox, {
|
||||
ghostClass: 'ui-fav-sortable-placeholder',
|
||||
draggable: 'li:not([data-id$="add"])',
|
||||
delay: 25,
|
||||
dataIdAttr: 'data-id',
|
||||
onSort: function(event)
|
||||
{
|
||||
var favSortedList = jQuery(this).sortable('toArray', {attribute:'data-id'});
|
||||
|
||||
egw().set_preference(currentAppName,'fav_sort_pref',favSortedList);
|
||||
let favSortedList = sortablejs.toArray();
|
||||
self.egw.set_preference(currentAppName, 'fav_sort_pref', favSortedList);
|
||||
self._refresh_fav_nm();
|
||||
}
|
||||
});
|
||||
|
||||
if (sidebox.length) app[_app.appName]._init_sidebox.call(app[_app.appName], sidebox);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,6 @@
|
||||
|
||||
import "../../../vendor/bower-asset/jquery/dist/jquery.min.js";
|
||||
import "../jquery/jquery.noconflict.js";
|
||||
//import "../../../vendor/bower-asset/jquery-ui/jquery-ui.js";
|
||||
import './fw_base.js';
|
||||
import './fw_browser.js';
|
||||
import './fw_ui.js';
|
||||
|
Reference in New Issue
Block a user