From bee365095d2fadc41318521bec222d79d12ebe7d Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Wed, 16 Dec 2009 22:25:05 +0000 Subject: [PATCH] BUGFIX: #4841 Changed live event binding to concrete event binding. Live was binding the event to document object, resulting in the handler being executed on any click within the page. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@95699 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/CMSMain.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/javascript/CMSMain.js b/javascript/CMSMain.js index a51f8c41..68b97213 100644 --- a/javascript/CMSMain.js +++ b/javascript/CMSMain.js @@ -216,23 +216,6 @@ * All forms loaded via ajax from the Form_SideReports dropdown. */ $("#SideReportsHolder form").concrete({ - onmatch: function() { - // links in results - this.find('ul a').live('click', function(e) { - var $link = $(this); - $link.addClass('loading'); - jQuery('#Form_EditForm').concrete('ss').loadForm( - $(this).attr('href'), - function(e) { - $link.removeClass('loading'); - } - ); - return false; - }); - - this._super(); - }, - onsubmit: function() { var self = this; @@ -256,6 +239,20 @@ } }); + + $("#SideReportsHolder form ul a").concrete({ + onclick: function() { + var $link = $(this); + $link.addClass('loading'); + jQuery('#Form_EditForm').concrete('ss').loadForm( + $(this).attr('href'), + function(e) { + $link.removeClass('loading'); + } + ); + return false; + } + }); /** * @class Simple form showing versions of a specific page.