فهرست منبع

fix ajax url() context. fixes #895

Igor Vaynberg 12 سال پیش
والد
کامیت
38758d754b
1فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 4 4
      select2.js

+ 4 - 4
select2.js

@@ -355,14 +355,14 @@ the specific language governing permissions and limitations under the Apache Lic
                     type = options.type || 'GET', // set type of request (GET or POST)
                     params = {};
 
-                data = data ? data.call(self.opts.element, query.term, query.page, query.context) : null;
-                url = (typeof url === 'function') ? url.call(self.opts.element, query.term, query.page, query.context) : url;
+                data = data ? data.call(self, query.term, query.page, query.context) : null;
+                url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
 
                 if( null !== handler) { handler.abort(); }
 
                 if (options.params) {
                     if ($.isFunction(options.params)) {
-                        $.extend(params, options.params.call(self.opts.element));
+                        $.extend(params, options.params.call(self));
                     } else {
                         $.extend(params, options.params);
                     }
@@ -383,7 +383,7 @@ the specific language governing permissions and limitations under the Apache Lic
                         query.callback(results);
                     }
                 });
-                handler = transport.call(self.opts.element, params);
+                handler = transport.call(self, params);
             }, quietMillis);
         };
     }