Skip to content

Commit

Permalink
Rework previous anchor fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jadahl committed Mar 16, 2011
1 parent c171476 commit 8802fd4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/wf_event.erl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ update_context_for_first_request() ->
Module = wf_context:page_module(),
wf_context:event_module(Module),
wf_context:type(first_request),
wf_context:anchor(".page"),
wf_context:anchor("page"),
ok.

update_context_for_postback_request(Event) ->
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wf_render_actions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ call_action_render(Module, Action, Anchor, Trigger, Target) ->
normalize_path(undefined) ->
undefined;
normalize_path(page) ->
".page";
"page";
normalize_path(Path) when is_atom(Path) ->
String = atom_to_list(Path),
Tokens = string:tokens(String, "."),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/wf_render_elements.erl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ call_element_render(Module, Element) ->
normalize_id(ID) ->
case wf:to_string_list(ID) of
[".wfid_" ++ _] = [NormalizedID] -> NormalizedID;
["page"] -> ".page";
["page"] -> "page";
[NewID] -> ".wfid_" ++ NewID
end.

Expand Down
12 changes: 10 additions & 2 deletions www/nitrogen.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@ function NitrogenClass(o) {

/*** PRIVATE METHODS ***/

NitrogenClass.prototype.$path_alias = function(path) {
if (path === 'page') {
return document;
} else {
return path;
}
}

NitrogenClass.prototype.$anchor = function(anchor, target) {
this.$anchor_path = anchor;
this.$target_path = target;
this.$anchor_path = this.$path_alias(anchor);
this.$target_path = this.$path_alias(target);
}

NitrogenClass.prototype.$set_param = function(key, value) {
Expand Down

0 comments on commit 8802fd4

Please sign in to comment.