From cf76bf2df5b31cec63695bb440b0394e7ed5b164 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 23 Mar 2015 13:27:25 +0000 Subject: [PATCH] Make query callback parameters more useful (& documented) by passing the link widget instead of response --- etemplate/js/et2_widget_link.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 01e7bc393f..217dea338d 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -522,7 +522,7 @@ var et2_link_entry = et2_inputWidget.extend( "name": "Query callback", "type": "js", "default": et2_no_init, - "description": "Callback before query to server. Must return true, or false to abort query." + "description": "Callback before query to server. It will be passed the request & et2_link_entry objects. Must return true, or false to abort query." }, "select": { "name": "Select callback", @@ -921,7 +921,7 @@ var et2_link_entry = et2_inputWidget.extend( // Allow hook / tie in if(this.options.query && typeof this.options.query == 'function') { - if(!this.options.query(request, response)) return false; + if(!this.options.query(request, this)) return false; } if((typeof request.no_cache == 'undefined' && !request.no_cache) && request.term in this.cache) {