From: cash Date: Fri, 19 Nov 2010 22:34:17 +0000 (+0000) Subject: improving interactions of widgets - containment wasn't working due to height issues X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=2da8c3e8428f09bab7aefa39cadc0a4f2d6f7a80;p=lorea%2Felgg.git improving interactions of widgets - containment wasn't working due to height issues git-svn-id: http://code.elgg.org/elgg/trunk@7353 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/actions/widgets/add.php b/actions/widgets/add.php index eebbd1438..001c139d8 100644 --- a/actions/widgets/add.php +++ b/actions/widgets/add.php @@ -11,7 +11,6 @@ $handler = get_input('handler'); $context = get_input('context'); $column = get_input('column', 1); -$guid = false; if (!empty($user_guid)) { $user = get_entity($user_guid); if ($user && $user->canEdit()) { diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php index 1343e1319..1646c18d4 100644 --- a/engine/lib/widgets.php +++ b/engine/lib/widgets.php @@ -57,7 +57,7 @@ function elgg_get_widgets($user_guid, $context) { * @since 1.8 */ function elgg_create_widget($owner_guid, $handler, $access_id = null) { - if (empty($owner_guid) || empty($handler) || !elgg_widget_type_exists($handler)) { + if (empty($owner_guid) || empty($handler) || !elgg_is_widget_type($handler)) { return false; } diff --git a/js/lib/ui.widgets.js b/js/lib/ui.widgets.js index bee4b2126..ac55d0e7f 100644 --- a/js/lib/ui.widgets.js +++ b/js/lib/ui.widgets.js @@ -12,6 +12,9 @@ elgg.ui.widgets.init = function() { handle: 'div.drag_handle', forcePlaceholderSize: true, placeholder: 'widget_placeholder', + //containment: '.widget_layout', + opacity: 0.8, + revert: 500, stop: function(event, ui) { elgg.action('widgets/move', { data: { @@ -26,11 +29,11 @@ elgg.ui.widgets.init = function() { }); $('#widget_add_button a').bind('click', function(event) { - $('.widgets_add').slideToggle('medium'); + $('.widgets_add_panel').slideToggle('medium'); event.preventDefault(); }); - $('.widgets_add a').bind('click', function(event) { + $('.widgets_add_panel a').bind('click', function(event) { elgg.action('widgets/add', { data: { handler: $(this).attr('id'), diff --git a/views/default/css.php b/views/default/css.php index 29930d445..286beeece 100644 --- a/views/default/css.php +++ b/views/default/css.php @@ -881,21 +881,21 @@ li.navigation_more ul li { margin-bottom: 15px; margin-right: 5px; } -.widgets_add { +.widgets_add_panel { padding: 10px; margin: 0 5px 15px; background: #dedede; } -.widgets_add ul { +.widgets_add_panel ul { padding: 0; margin: 0; } -.widgets_add li { +.widgets_add_panel li { float: left; margin: 2px 10px; list-style: none; } -.widgets_add li a { +.widgets_add_panel li a { display: block; width: 200px; padding: 4px; @@ -906,7 +906,11 @@ li.navigation_more ul li { padding: 2px; margin: 0 5px 15px; } +.widget:hover { + background-color: #cccccc; +} .widget_title { + background-color: #dedede; height: 30px; line-height: 30px; } diff --git a/views/default/layouts/widgets.php b/views/default/layouts/widgets.php index 055b0453e..692d01acc 100644 --- a/views/default/layouts/widgets.php +++ b/views/default/layouts/widgets.php @@ -25,9 +25,11 @@ if (elgg_can_edit_widgets()) { 'widgets' => $widgets, 'context' => $context, ); - echo elgg_view('widgets/add', $params); + echo elgg_view('widgets/add_panel', $params); } +echo '
'; + echo $vars['box']; $widget_class = "widget_{$num_columns}_columns"; @@ -43,4 +45,7 @@ for ($column_index = 1; $column_index <= $num_columns; $column_index++) { echo '
'; } +echo '
'; +echo ''; + elgg_pop_context(); \ No newline at end of file diff --git a/views/default/widgets/add.php b/views/default/widgets/add_panel.php similarity index 94% rename from views/default/widgets/add.php rename to views/default/widgets/add_panel.php index c8576cf06..70d80f41c 100644 --- a/views/default/widgets/add.php +++ b/views/default/widgets/add_panel.php @@ -6,7 +6,7 @@ $widget_types = elgg_get_widget_types(); $context = $vars['context']; ?> -