Skip to content

Commit 38758d7

Browse files
committed
fix ajax url() context. fixes select2#895
1 parent 70be25c commit 38758d7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

select2.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,14 @@ the specific language governing permissions and limitations under the Apache Lic
355355
type = options.type || 'GET', // set type of request (GET or POST)
356356
params = {};
357357

358-
data = data ? data.call(self.opts.element, query.term, query.page, query.context) : null;
359-
url = (typeof url === 'function') ? url.call(self.opts.element, query.term, query.page, query.context) : url;
358+
data = data ? data.call(self, query.term, query.page, query.context) : null;
359+
url = (typeof url === 'function') ? url.call(self, query.term, query.page, query.context) : url;
360360

361361
if( null !== handler) { handler.abort(); }
362362

363363
if (options.params) {
364364
if ($.isFunction(options.params)) {
365-
$.extend(params, options.params.call(self.opts.element));
365+
$.extend(params, options.params.call(self));
366366
} else {
367367
$.extend(params, options.params);
368368
}
@@ -383,7 +383,7 @@ the specific language governing permissions and limitations under the Apache Lic
383383
query.callback(results);
384384
}
385385
});
386-
handler = transport.call(self.opts.element, params);
386+
handler = transport.call(self, params);
387387
}, quietMillis);
388388
};
389389
}

0 commit comments

Comments
 (0)