diff --git a/README.md b/README.md index fb52d44..d31f607 100644 --- a/README.md +++ b/README.md @@ -15,21 +15,7 @@ Features - Adding widgets from a lightbox - Index widgets (with a few different layouts) - Group widgets (instead of group profile modules) - - Forcing of widget (incl positioning) on profile/dashboard (also later!) - Option to globally hide a specific widgettype (will even hide widget already placed on profile/dashboard) - Create group default widgets - Create extra pages with a widget layout - -Info about the fix mechanisme for Default Widgets -------------------------------------------------- - -Fixed widgets always - - - Appear on top of other widgets - - Can not be removed or edited or dragged by a user - - Maintain a relation to their default widget, so if the default widgets changes, all user widgets also change! - - New fixed widgets will also be added to existing users - -You can fix widgets on a dashboard or profile page. Fixing widgets can be done by clicking on the pin in the widget header. Only default widgets added when widget manager is enabled will have the option to fix. This is because a special attribute will be set on the default widget to keep a relation to the widget when cloning it to the user profile or dashboard. If you do not see the pin, remove the widget and add it again. - -A user can always add his or hers own widgets. They will always be added below the last fixed widget in the destination column. + \ No newline at end of file diff --git a/views/default/js/widget_manager/add_panel.js b/views/default/js/widget_manager/add_panel.js index e4aa994..23ac7a5 100644 --- a/views/default/js/widget_manager/add_panel.js +++ b/views/default/js/widget_manager/add_panel.js @@ -16,27 +16,4 @@ define(['jquery', 'elgg', 'elgg/Ajax', 'elgg/widgets'], function($, elgg, Ajax, }).show(); } }); - - $(document).ajaxSuccess(function (e, xhr, settings) { - if (settings.url === elgg.normalize_url('/action/widgets/add')) { - // move new widget to a new position (after fixed widgets) if needed - if ($(this).find('.elgg-widgets > .elgg-state-fixed').size() > 0) { - var $widget = $(this).find('.elgg-module-widget:first'); - $widget.insertAfter($(this).find('.elgg-widgets > .elgg-state-fixed:last')); - - // first item is the recently moved widget, because fixed widgets are not part of the sortable - var index = $(this).find('.elgg-module-widget').index($widget); - var guidString = $widget.attr('id'); - guidString = guidString.substr(guidString.indexOf('elgg-widget-') + "elgg-widget-".length); - - ajax.action('widgets/move', { - data: { - widget_guid: guidString, - column: 1, - position: index - } - }); - } - } - }); }); diff --git a/views/default/object/widget.php b/views/default/object/widget.php index f23bfb9..863a32d 100644 --- a/views/default/object/widget.php +++ b/views/default/object/widget.php @@ -31,7 +31,9 @@ $can_edit = $widget->canEdit(); $widget_class = elgg_extract_class($vars, $widget_instance); -$widget_class[] = $can_edit ? 'elgg-state-draggable' : 'elgg-state-fixed'; +if ($can_edit) { + $widget_class[] = 'elgg-state-draggable'; +} if ($widget->widget_manager_custom_class) { $widget_class[] = $widget->widget_manager_custom_class; // optional custom class for this widget