1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-26 01:11:28 +02:00

Fixes #4940 - Flexpanel was not displaying moved core items correctly.

This commit is contained in:
camer0n
2023-11-18 08:45:15 -08:00
parent 6b7aa7c6d9
commit dcd1745bad
2 changed files with 17 additions and 5 deletions

View File

@@ -342,6 +342,8 @@ class adminstyle_flexpanel extends adminstyle_infopanel
*/ */
function getMenuPosition($id) function getMenuPosition($id)
{ {
$id = str_replace('_', '-', $id); // fix for core news etc.
$user_pref = $this->getUserPref(); $user_pref = $this->getUserPref();
if(!empty($user_pref['core-flexpanel-order'][$id])) if(!empty($user_pref['core-flexpanel-order'][$id]))

View File

@@ -1,5 +1,7 @@
var e107 = e107 || {'settings': {}, 'behaviors': {}}; var e107 = e107 || {'settings': {}, 'behaviors': {}};
(function ($) (function ($)
{ {
'use strict'; 'use strict';
@@ -24,8 +26,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$(context).find(selector).once(onceKey).each(function () $(context).find(selector).once(onceKey).each(function ()
{ {
var $panel = $(this); var $panel = $(this)
try {
$panel.sortable({ $panel.sortable({
connectWith: selector, connectWith: selector,
items: e107.settings.flexPanel.items, items: e107.settings.flexPanel.items,
@@ -63,9 +66,13 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$draggablePanels.css('background-color', 'transparent'); $draggablePanels.css('background-color', 'transparent');
e107.callbacks.flexPanelSavePanelOrder(); e107.callbacks.flexPanelSavePanelOrder();
e107.callbacks.flexPanelEmptyPanels(); e107.callbacks.flexPanelEmptyPanels();
} }
}); });
}
catch (error) {
console.error(error);
}
}); });
e107.callbacks.flexPanelEmptyPanels(); e107.callbacks.flexPanelEmptyPanels();
@@ -99,9 +106,12 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
}); });
} }
}); });
$.post(window.location.href, {'core-flexpanel-order': NewOrder}).done(function( data ) { $.post(window.location.href, {'core-flexpanel-order': NewOrder})
console.log(data); .done(function(data) {
}).fail(function(jqXHR, textStatus, errorThrown) {
console.error('An error occurred: ' + errorThrown);
}); });
}; };