Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix Back button when viewing an asset.

Has been broken by the HTML 5 standard, which has image inputs no longer submit their values, but their .x and .y positions. This is annoying, and more like how IE has always behaved. In [this commit](534e739) (and others like it for media nd templates), Scott fixed a bug related to get the Return button to work on the diff view. Removing that change fixes the view Return button, but breaks the Diff return button. So switch to using a very simple image link for the Diff page return button instead of the image input. That works on any browser, and so now the Return button should work properly both when viewing assets and when viewing diffs.

[#240 state:closed]
  • Loading branch information...
commit 6fbfbac9b29eb3ec9f2e4d4f0d9168c1187d9e75 1 parent 4d4d18a
@theory theory authored
View
19 comp/widgets/media_prof/view_meta.html
@@ -171,14 +171,17 @@
&>
<& '/widgets/wrappers/table_bottom.mc' &>
% }
-<& '/widgets/profile/button.mc',
- disp => $lang->maketext("Return"),
- value => $param->{diff} ? 'diff' : undef,
- widget => $widget,
- cb => 'return_cb',
- button => 'return_dgreen',
- useTable => 0,
-&>
+% if ($param->{diff}) {
+ <& '/lib/util/back_button.mc' &>
+% } else {
+ <& '/widgets/profile/button.mc',
+ disp => $lang->maketext("Return"),
+ widget => $widget,
+ cb => 'return_cb',
+ button => 'return_dgreen',
+ useTable => 0,
+ &>
+% }
<%args>
$widget
$param
View
18 comp/widgets/story_prof/view_meta.html
@@ -190,13 +190,17 @@
&>
<& '/widgets/wrappers/table_bottom.mc' &>
% }
-<& '/widgets/profile/button.mc',
- disp => $lang->maketext("Return"),
- value => $param->{diff} ? 'diff' : undef,
- widget => $widget,
- cb => 'return_cb',
- button => 'return_dgreen',
- useTable => 0 &>
+% if ($param->{diff}) {
+ <& '/lib/util/back_button.mc' &>
+% } else {
+ <& '/widgets/profile/button.mc',
+ disp => $lang->maketext("Return"),
+ widget => $widget,
+ cb => 'return_cb',
+ button => 'return_dgreen',
+ useTable => 0
+ &>
+% }
<%args>
$widget
$param
View
18 comp/widgets/tmpl_prof/view_meta.html
@@ -78,13 +78,17 @@
&>
<& '/widgets/wrappers/table_bottom.mc' &>
% }
-<& '/widgets/profile/button.mc',
- disp => 'Return',
- widget => $widget,
- cb => 'return_cb',
- button => 'return_dgreen',
- value => $param->{diff} ? 'diff' : undef,
- useTable => 0 &>
+% if ($param->{diff}) {
+ <& '/lib/util/back_button.mc' &>
+% } else {
+ <& '/widgets/profile/button.mc',
+ disp => 'Return',
+ widget => $widget,
+ cb => 'return_cb',
+ button => 'return_dgreen',
+ useTable => 0
+&>
+% }
<%args>
$widget
$param
View
4 lib/Bric/App/Callback/Profile/Media.pm
@@ -453,9 +453,7 @@ sub return : Callback(priority => 6) {
my $version_view = get_state_data($widget, 'version_view');
my $media = get_state_data($widget, 'media');
- # note: $self->value =~ /^\d+$/ is for IE which sends the .x or .y position
- # of the mouse for <input type="image"> buttons
- if ($version_view || $self->value eq 'diff' || $self->value =~ /^\d+$/) {
+ if ($version_view || $self->value eq 'diff') {
my $media_id = $media->get_id;
$self->clear_my_state if $version_view;
$self->set_redirect("/workflow/profile/media/$media_id/?checkout=1");
View
5 lib/Bric/App/Callback/Profile/Story.pm
@@ -327,10 +327,7 @@ sub return : Callback(priority => 6) {
my $version_view = get_state_data($widget, 'version_view');
my $story = get_state_data($widget, 'story');
-
- # note: $self->value =~ /^\d+$/ is for IE which sends the .x or .y position
- # of the mouse for <input type="image"> buttons
- if ($version_view || $self->value eq 'diff' || $self->value =~ /^\d+$/) {
+ if ($version_view || $self->value eq 'diff') {
my $story_id = $story->get_id;
$self->clear_my_state if $version_view;
$self->set_redirect("/workflow/profile/story/$story_id/?checkout=1");
View
4 lib/Bric/App/Callback/Profile/Template.pm
@@ -246,9 +246,7 @@ sub return : Callback(priority => 6) {
my $version_view = get_state_data($widget, 'version_view');
my $fa = get_state_data($widget, 'template');
- # note: $self->value =~ /^\d+$/ is for IE which sends the .x or .y position
- # of the mouse for <input type="image"> buttons
- if ($version_view || $self->value eq 'diff' || $self->value =~ /^\d+$/) {
+ if ($version_view || $self->value eq 'diff') {
my $fa_id = $fa->get_id;
clear_state($widget) if $version_view;
$self->set_redirect("/workflow/profile/template/$fa_id/?checkout=1");

0 comments on commit 6fbfbac

Please sign in to comment.
Something went wrong with that request. Please try again.