Skip to content

Commit

Permalink
Item9815: When moving the code, forgot to change the parameters. Unit…
Browse files Browse the repository at this point in the history
… tests didn't like that. Also remove prefixing IDs with twistyId when user specified an id

git-svn-id: http://svn.foswiki.org/trunk@9712 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Oct 24, 2010
1 parent 98f5284 commit f8e9247
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ sub _TWISTY {
my ( $session, $params, $theTopic, $theWeb ) = @_;

_addHeader();
$params->{'id'} = _createId( $params->{'id'}, $theWeb, $theTopic );
$params->{'id'} = _createId( $params, $theWeb, $theTopic );
return _TWISTYBUTTON( $session, $params, $theTopic, $theWeb )
. _TWISTYTOGGLE( $session, $params, $theTopic, $theWeb );
}
Expand Down Expand Up @@ -202,9 +202,9 @@ sub _ENDTWISTYTOGGLE {
}

sub _createId {
my ( $inRawId, $inWeb, $inTopic ) = @_;
my ( $params, $inWeb, $inTopic ) = @_;

my $id = $inRawId ? $inRawId : "$inWeb$inTopic";
my $id = $params->{'id'} || "twistyId$inWeb$inTopic";
$id =~ s/\//subweb/go;

# Ensure uniqueness, or at least try to
Expand All @@ -215,7 +215,7 @@ sub _createId {
else { # 100 is the number of remembered cookies to avoid clashes
$id .= int( rand(10000) ) + 100; # For AJAX
}
return "twistyId$id";
return $id;
}

sub _twistyBtn {
Expand Down

0 comments on commit f8e9247

Please sign in to comment.