Browse Source

Fixed JS breakage due to undefined variable, viewPortLeft.

Oshane Bailey 10 years ago
parent
commit
9207f23073
1 changed files with 2 additions and 2 deletions
  1. 2 2
      select2.js

+ 2 - 2
select2.js

@@ -1244,7 +1244,7 @@ the specific language governing permissions and limitations under the Apache Lic
                     return dropLeft + dropWidth <= viewPortRight;
                     return dropLeft + dropWidth <= viewPortRight;
                 },
                 },
                 enoughRoomOnLeft = function() {
                 enoughRoomOnLeft = function() {
-                    return offset.left + viewPortLeft + container.outerWidth(false)  > dropWidth;
+                    return offset.left + viewPortRight + container.outerWidth(false)  > dropWidth;
                 },
                 },
                 aboveNow = $dropdown.hasClass("select2-drop-above"),
                 aboveNow = $dropdown.hasClass("select2-drop-above"),
                 bodyOffset,
                 bodyOffset,
@@ -3237,7 +3237,7 @@ the specific language governing permissions and limitations under the Apache Lic
                     if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
                     if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
                         current.splice(i, 1);
                         current.splice(i, 1);
                         if(i>0){
                         if(i>0){
-                        	i--;
+                            i--;
                         }
                         }
                         old.splice(j, 1);
                         old.splice(j, 1);
                         j--;
                         j--;