浏览代码

TypeError: Cannot call method 'positionDropdown' of undefined

Vitaly 12 年之前
父节点
当前提交
dea7979f11
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -1129,12 +1129,13 @@ the specific language governing permissions and limitations under the Apache Lic
 
             // attach listeners to events that can change the position of the container and thus require
             // the position of the dropdown to be updated as well so it does not come unglued from the container
+            var that = this;
             this.container.parents().add(window).each(function () {
                 $(this).bind(resize+" "+scroll+" "+orient, function (e) {
                     $("#select2-drop-mask").css({
                         width:document.documentElement.scrollWidth,
                         height:document.documentElement.scrollHeight});
-                    $("#select2-drop").data("select2").positionDropdown();
+                    that.positionDropdown();
                 });
             });