[How-To] Disable double click on Reply buttons
by
10 Feb 2010
Rating: (1 vote
- 5.00 average)
This article discusses code modifications made directly in the files, and will need to be done each time you upgrade vBulletin. If possible I will write a plugin when I get a chance, and this note and article will become irrelevant. [How-To] Disable Double-Click On Reply Buttons A lot of people agree that the new double-click functionality for the "Reply With Quote" and "+ Reply to Thread" buttons is not user friendly, and not a standard behavior for buttons on a web page. The biggest complaint is having to click twice to get to the regular Advanced editor. It doesn't appear that the developers are going to change this soon, if ever, so until they do I went digging for a solution to bring back the familiar and very user friendly single-click action for these buttons. Go to your clientscript folder, and open the vbulletin_quick_reply.js file. Look for this section of code: Code:
function qr_init_buttons(obj) { // intercept post button clicks to use inline form var anchors = fetch_tags(obj, 'a'); for (var i = 0; i < anchors.length; i++) { // reply button if (anchors[i].id && (anchors[i].id.substr(0, 3) == 'qr_' || anchors[i].id.substr(0, 5) == 'qrwq_')) { YAHOO.util.Event.on(anchors[i], "click", qr_newreply_activate, this); //anchors[i].onclick = function(e) { return qr_newreply_activate(this.id.substr(3), false); }; } } // set the "+Reply to Thread" buttons onlclick events var replytothreadids = ["newreplylink_top", "newreplylink_bottom"]; YAHOO.util.Event.on(replytothreadids, "click", qr_replytothread_activate, this); //YAHOO.util.Event.on(replytothreadids, "dblclick", function(e) { window.location = this.href; }, this); } Code:
function qr_init_buttons(obj) { // intercept post button clicks to use inline form var anchors = fetch_tags(obj, 'a'); for (var i = 0; i < anchors.length; i++) { // reply button if (anchors[i].id && (anchors[i].id.substr(0, 3) == 'qr_' || anchors[i].id.substr(0, 5) == 'qrwq_')) { //YAHOO.util.Event.on(anchors[i], "click", qr_newreply_activate, this); //anchors[i].onclick = function(e) { return qr_newreply_activate(this.id.substr(3), false); }; } } // set the "+Reply to Thread" buttons onlclick events var replytothreadids = ["newreplylink_top", "newreplylink_bottom"]; //YAHOO.util.Event.on(replytothreadids, "click", qr_replytothread_activate, this); //YAHOO.util.Event.on(replytothreadids, "dblclick", function(e) { window.location = this.href; }, this); } The blue commented line reverts the "+ Reply to Thread" buttons back to single click, which takes you directly to the Advanced editor. One more thing, Multi-quote behavior depends on which line(s) you comment out. If you ever want to use the default double-click behavior for either button, simply remove the two forward slashes that you added. And remember, until I create the plugin/product, you will need to make this change each time you upgrade your forums. |