Author: andre Date: 2010-02-24 16:45:20 +0100 (Wed, 24 Feb 2010) New Revision: 41158
Modified: mmbase/branches/MMBase-1_9/applications/searchrelate/src/main/webapp/mmbase/searchrelate/Searcher.js.jsp Log: dropped instant attribute, let "instant" depend on presence of submit attribute Modified: mmbase/branches/MMBase-1_9/applications/searchrelate/src/main/webapp/mmbase/searchrelate/Searcher.js.jsp =================================================================== --- mmbase/branches/MMBase-1_9/applications/searchrelate/src/main/webapp/mmbase/searchrelate/Searcher.js.jsp 2010-02-24 15:45:07 UTC (rev 41157) +++ mmbase/branches/MMBase-1_9/applications/searchrelate/src/main/webapp/mmbase/searchrelate/Searcher.js.jsp 2010-02-24 15:45:20 UTC (rev 41158) @@ -91,6 +91,7 @@ fun(this); } this.sessionName = null; + this.bindCommit(); var self = this; $(this.div).trigger("mmsrRelaterReady", [self]); } @@ -111,8 +112,6 @@ MMBaseRelater.readyFunctions[MMBaseRelater.readyFunctions.length] = fun; } - - MMBaseRelater.prototype.addSearcher = function(el, type) { var relater = this; if ($(el).hasClass("searchable")) { @@ -145,6 +144,20 @@ } } +MMBaseRelater.prototype.bindCommit = function() { + if (this.instant) { + $(this.div).bind("mmsrRelate", function (e, tr, relater) { + if (e) { + self.commit(e); + } + }); + $(this.div).bind("mmsrUnrelate", function (e, tr, relater) { + if (e) { + self.commit(e); + } + }); + } +} MMBaseRelater.prototype.needsCommit = function() { var relatedNumbers = this.getNumbers(this.related); @@ -152,7 +165,6 @@ return relatedNumbers != "" || unrelatedNumbers != ""; } - /** * Commits makes changes to MMBase. Depends on a jsp /mmbase/searchrelate/relate.jsp to do the actual work. * This jsp, in turn, depends on the query in the user's session which defines precisely what must happen. _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs