diff --git a/e107_admin/includes/flexpanel.php b/e107_admin/includes/flexpanel.php index c215e6bbe0..90ff382b9d 100644 --- a/e107_admin/includes/flexpanel.php +++ b/e107_admin/includes/flexpanel.php @@ -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])) diff --git a/e107_web/js/core/admin.flexpanel.js b/e107_web/js/core/admin.flexpanel.js index def196f399..67977fd3aa 100644 --- a/e107_web/js/core/admin.flexpanel.js +++ b/e107_web/js/core/admin.flexpanel.js @@ -1,5 +1,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; + + (function ($) { 'use strict'; @@ -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, @@ -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(); @@ -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); }); };