diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 19:48:05 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 19:48:05 +0000 |
commit | a13b91d36ac72f0045a03402dc7040a226102ff5 (patch) | |
tree | 3ca3c2e4917926351a3f724d3eada836aa674f51 | |
parent | 6b41bd72667ce810257a6ed35f090d3c702fb59e (diff) | |
download | elgg-a13b91d36ac72f0045a03402dc7040a226102ff5.tar.gz elgg-a13b91d36ac72f0045a03402dc7040a226102ff5.tar.bz2 |
Fixes #3032: toggler pattern is now <a href="#target" class="elgg-toggler">...</a> Wow, so much nicer.
git-svn-id: http://code.elgg.org/elgg/trunk@8538 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/classes/ElggMenuItem.php | 2 | ||||
-rw-r--r-- | js/lib/ui.js | 9 | ||||
-rwxr-xr-x | mod/profile/views/default/profile/owner_block.php | 4 | ||||
-rw-r--r-- | mod/reportedcontent/views/default/object/reported_content.php | 4 | ||||
-rw-r--r-- | views/default/core/account/login_dropdown.php | 6 | ||||
-rw-r--r-- | views/default/object/plugin/advanced.php | 10 | ||||
-rw-r--r-- | views/default/object/widget/elements/controls.php | 4 | ||||
-rw-r--r-- | views/default/page/layouts/widgets/add_button.php | 2 | ||||
-rw-r--r-- | views/default/river/item/controls.php | 4 |
9 files changed, 27 insertions, 18 deletions
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index f0553dfb7..1e1981ab9 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -413,6 +413,8 @@ class ElggMenuItem { * @params array $vars Options to pass to output/url if a link * * @return string + * + * @todo View code in a model. How do we feel about that? */ public function getContent(array $vars = array()) { diff --git a/js/lib/ui.js b/js/lib/ui.js index df3c102ce..3118bb408 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -25,8 +25,7 @@ elgg.ui.init = function () { * Toggles an element based on clicking a separate element * * Use .elgg-toggler on the toggler element - * Add another class to the toggler called elgg-toggles-<id> - * The id of the element being toggled is <id> + * Set the href to target the item you want to toggle (<a href="#id-of-target">) * * @param {Object} event * @return void @@ -34,11 +33,9 @@ elgg.ui.init = function () { elgg.ui.toggles = function(event) { event.preventDefault(); - $(this).toggleClass('elgg-state-active'); + var target = $(this).toggleClass('elgg-state-active').attr('href'); - var togglees = $(this).attr('class').match(/elgg-toggles-[^ ]*/i); - - $('#' + togglees[0].replace('elgg-toggles-', '')).slideToggle('medium'); + $(target).slideToggle('medium'); } /** diff --git a/mod/profile/views/default/profile/owner_block.php b/mod/profile/views/default/profile/owner_block.php index e458469e4..b8f912649 100755 --- a/mod/profile/views/default/profile/owner_block.php +++ b/mod/profile/views/default/profile/owner_block.php @@ -33,8 +33,8 @@ if (elgg_is_logged_in() && $actions) { $admin_links = ''; if (elgg_is_admin_logged_in() && elgg_get_logged_in_user_guid() != elgg_get_page_owner_guid()) { $admin_links = '<ul class="profile-admin-menu-wrapper">'; - $admin_links .= '<li><a class="elgg-toggler elgg-toggles-admin-menu">Admin options…</a>'; - $admin_links .= '<ul class="profile-admin-menu" id="admin-menu">'; + $admin_links .= '<li><a class="elgg-toggler href="#profile-menu-admin">Admin options…</a>'; + $admin_links .= '<ul class="profile-admin-menu" id="profile-menu-admin">'; foreach ($admin as $menu_item) { $admin_links .= elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); } diff --git a/mod/reportedcontent/views/default/object/reported_content.php b/mod/reportedcontent/views/default/object/reported_content.php index 9ac878ab4..044a40012 100644 --- a/mod/reportedcontent/views/default/object/reported_content.php +++ b/mod/reportedcontent/views/default/object/reported_content.php @@ -55,9 +55,9 @@ if ($report->state == 'archived') { <?php echo $report->title; ?> <br /> <?php echo elgg_view('output/url', array( - 'href' => '#', + 'href' => "#report-$report->guid", 'text' => elgg_echo('reportedcontent:moreinfo'), - 'class' => "elgg-toggler elgg-toggles-report-$report->guid", + 'class' => "elgg-toggler", )); ?> </p> diff --git a/views/default/core/account/login_dropdown.php b/views/default/core/account/login_dropdown.php index 06a9a15fb..3c62a5448 100644 --- a/views/default/core/account/login_dropdown.php +++ b/views/default/core/account/login_dropdown.php @@ -21,8 +21,10 @@ $body = elgg_view_form('login', array('action' => "{$login_url}action/login"), a echo elgg_view('output/url', array( 'href' => 'pg/login', 'text' => elgg_echo('login'), - 'class' => "elgg-button elgg-button-dropdown elgg-toggler elgg-toggles-login-dropdown-box", )); echo elgg_view_module('dropdown', '', $body, array('id' => 'login-dropdown-box')); ?> -</div>
\ No newline at end of file +</div> +<script> + $('#login-dropdown > a').attr('href', '#login-dropdown-box').addClass('elgg-toggler elgg-button elgg-button-dropdown'); +</script>
\ No newline at end of file diff --git a/views/default/object/plugin/advanced.php b/views/default/object/plugin/advanced.php index d89506319..4ff2dffa8 100644 --- a/views/default/object/plugin/advanced.php +++ b/views/default/object/plugin/advanced.php @@ -191,7 +191,15 @@ if (elgg_view_exists($settings_view)) { <div class="plugin_description"><?php echo $description; ?></div> <p class="plugin_author"><?php echo $author . ' - ' . $website; ?></p> - <div class="pts"><a class="elgg-toggler elgg-toggles-elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"><?php echo elgg_echo("admin:plugins:label:moreinfo"); ?></a></div> + <div class="pts"> + <?php + echo elgg_view('output/url', array( + 'href' => "#elgg-plugin-manifest-{$plugin->getID()}", + 'text' => elgg_echo("admin:plugins:label:moreinfo"), + 'class' => 'elgg-toggler', + )); + ?> + </div> </div> </div> <div class="hidden manifest_file" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>"> diff --git a/views/default/object/widget/elements/controls.php b/views/default/object/widget/elements/controls.php index 39eba471a..ba30d2d4d 100644 --- a/views/default/object/widget/elements/controls.php +++ b/views/default/object/widget/elements/controls.php @@ -32,8 +32,8 @@ if ($widget->canEdit()) { $params = array( 'text' => ' ', 'title' => elgg_echo('widget:edit'), - 'href' => "#", - 'class' => "elgg-widget-edit-button elgg-toggler elgg-toggles-widget-edit-$widget->guid", + 'href' => "#widget-edit-$widget->guid", + 'class' => "elgg-widget-edit-button elgg-toggler", ); $edit_link = elgg_view('output/url', $params); } diff --git a/views/default/page/layouts/widgets/add_button.php b/views/default/page/layouts/widgets/add_button.php index cfcbcc998..614b25332 100644 --- a/views/default/page/layouts/widgets/add_button.php +++ b/views/default/page/layouts/widgets/add_button.php @@ -4,7 +4,7 @@ */ ?> <div class="elgg-widget-add-control"> - <a class="elgg-button elgg-button-action elgg-toggler elgg-toggles-widgets-add-panel"> + <a class="elgg-button elgg-button-action elgg-toggler" href="#elgg-toggles-widgets-add-panel"> <?php echo elgg_echo('widgets:add'); ?> </a> </div> diff --git a/views/default/river/item/controls.php b/views/default/river/item/controls.php index 32653452b..96979f2c5 100644 --- a/views/default/river/item/controls.php +++ b/views/default/river/item/controls.php @@ -15,9 +15,9 @@ if (elgg_is_logged_in()) { if ($object->canComment()) { elgg_register_menu_item('river', array( 'name' => 'comment', - 'href' => '#', + 'href' => "#comments-add-$object->guid", 'text' => elgg_echo('generic_comments:text'), - 'class' => "elgg-toggler elgg-toggles-comments-add-{$object->getGUID()}", + 'class' => "elgg-toggler", )); } |