[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.8-162-gcae63fc
? sunnavy
sunnavy at bestpractical.com
Mon Sep 27 23:21:06 EDT 2010
The branch, 3.8-trunk has been updated
via cae63fc21aef7e836324cb2b969117b838abaf33 (commit)
from 38e5295af81539743c79f9cee8081030bc1ca2f7 (commit)
Summary of changes:
share/html/Helpers/Toggle/TicketBookmark | 3 ++-
share/html/NoAuth/js/util.js | 23 +++++++++++++++++++++++
share/html/Ticket/Elements/Bookmark | 4 ++--
3 files changed, 27 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit cae63fc21aef7e836324cb2b969117b838abaf33
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Sep 28 11:11:35 2010 +0800
change bookmark toggle from id to class so we can toggle more elements
diff --git a/share/html/Helpers/Toggle/TicketBookmark b/share/html/Helpers/Toggle/TicketBookmark
index ecd6914..718eb9b 100644
--- a/share/html/Helpers/Toggle/TicketBookmark
+++ b/share/html/Helpers/Toggle/TicketBookmark
@@ -47,8 +47,9 @@
%# END BPS TAGGED BLOCK }}}
<%ARGS>
$id
+$Toggle => 1
</%ARGS>
<%INIT>
-$m->comp('/Ticket/Elements/Bookmark', id => $id, Toggle => 1);
+$m->comp('/Ticket/Elements/Bookmark', id => $id, Toggle => $Toggle );
$m->abort();
</%INIT>
diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index c99fdea..908b72b 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -315,3 +315,26 @@ function checkboxToInput(target,checkbox,val){
}
}
+function toggleTicketBookmark( id, url ) {
+ var elements = $$("span.toggle-"+id);
+ if ( elements.length ) {
+ if ( elements.length == 1 ) {
+ new Ajax.Request(url, {
+ onSuccess: function(response) {
+ $(elements[0]).replace(response.responseText);
+ }
+ }
+ );
+ }
+ else {
+ new Ajax.Request(url);
+ new Ajax.Request(url+'&Toggle=0', {
+ onSuccess: function(response) {
+ elements.each( function( item ) {
+ item.replace(response.responseText);
+ })
+ }
+ });
+ }
+ }
+}
diff --git a/share/html/Ticket/Elements/Bookmark b/share/html/Ticket/Elements/Bookmark
index ecf08c7..1cc608b 100644
--- a/share/html/Ticket/Elements/Bookmark
+++ b/share/html/Ticket/Elements/Bookmark
@@ -81,9 +81,9 @@ if ( $Toggle ) {
$id
$Toggle => 0
</%ARGS>
-<span id="toggle-<% $id %>">
+<span id="toggle-<% $id %>" class="toggle-<% $id %>">
% my $url = RT->Config->Get('WebPath') ."/Helpers/Toggle/TicketBookmark?id=". $id;
-<a align="right" href="<% $url %>" onclick="ahah('<% $url |n %>', 'toggle-<% $id |n %>'); return false;" >
+<a align="right" href="<% $url %>" onclick="toggleTicketBookmark('<% $id|n %>', '<% $url %>'); return false;">
% if ( $bookmarked ) {
<img src="<% RT->Config->Get('WebPath') %>/NoAuth/images/star.gif" alt="<% loc('Remove Bookmark') %>" style="border-style: none" />
% } else {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list