Skip to content

Commit

Permalink
Fixes #4940 - Flexpanel was not displaying moved core items correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Nov 18, 2023
1 parent 6b7aa7c commit dcd1745
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions e107_admin/includes/flexpanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ public function render()
*/
function getMenuPosition($id)
{
$id = str_replace('_', '-', $id); // fix for core news etc.

$user_pref = $this->getUserPref();

if(!empty($user_pref['core-flexpanel-order'][$id]))
Expand Down
20 changes: 15 additions & 5 deletions e107_web/js/core/admin.flexpanel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var e107 = e107 || {'settings': {}, 'behaviors': {}};



(function ($)
{
'use strict';
Expand All @@ -24,8 +26,9 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};

$(context).find(selector).once(onceKey).each(function ()
{
var $panel = $(this);
var $panel = $(this)

try {
$panel.sortable({
connectWith: selector,
items: e107.settings.flexPanel.items,
Expand Down Expand Up @@ -63,9 +66,13 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
$draggablePanels.css('background-color', 'transparent');

e107.callbacks.flexPanelSavePanelOrder();
e107.callbacks.flexPanelEmptyPanels();
e107.callbacks.flexPanelEmptyPanels();
}
});
}
catch (error) {
console.error(error);
}
});

e107.callbacks.flexPanelEmptyPanels();
Expand Down Expand Up @@ -99,9 +106,12 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}};
});
}
});

$.post(window.location.href, {'core-flexpanel-order': NewOrder}).done(function( data ) {
console.log(data);

$.post(window.location.href, {'core-flexpanel-order': NewOrder})
.done(function(data) {

}).fail(function(jqXHR, textStatus, errorThrown) {
console.error('An error occurred: ' + errorThrown);
});
};

Expand Down

0 comments on commit dcd1745

Please sign in to comment.