Permalink
Browse files

MDL-36305 theme: Forum reply button is not removed using MyMobile

  • Loading branch information...
1 parent b969895 commit 37881d2f20c60fa93076d7e78d3b72809769115d @FMCorz FMCorz committed Nov 20, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 theme/mymobile/javascript/custom.js
View
8 theme/mymobile/javascript/custom.js
@@ -128,10 +128,14 @@ $(document).ready(function() {
//forum discussion page only stuff
$('div#page-mod-forum-discussPAGE, #page-mod-forum-discuss div.generalpage, div.forumtype-single, .forumtype-single div.generalpage, div#page-mod-forum-postPAGE').live('pagebeforecreate',function(event, ui){
- //remove parent post because of hash remove this if has listening is fixed
+ // Handle the '#' in the URLs.
$('.options div.commands a').each(function(index) {
var url = $(this).attr("href");
- if (url.indexOf("#") != -1) {
+ if (url.indexOf("post.php") != -1 && url.indexOf("reply=") != -1) {
+ // Remove the anchor from the reply link.
+ $(this).attr('href', url.replace('#mform1', ''));
+ } else if (url.indexOf("#") != -1) {
+ // Remove "Show parent" and other links which contains a '#'.
$(this).remove();
}
});

0 comments on commit 37881d2

Please sign in to comment.