From f54b485abc8059e637848840ef49cde46cd42530 Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 20 Nov 2012 13:54:13 +0800 Subject: [PATCH] MDL-36305 theme: Forum reply button is not removed using MyMobile --- theme/mymobile/javascript/custom.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/theme/mymobile/javascript/custom.js b/theme/mymobile/javascript/custom.js index 135e99cadab..b7c9a7697d1 100644 --- a/theme/mymobile/javascript/custom.js +++ b/theme/mymobile/javascript/custom.js @@ -127,10 +127,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(); } });