Skip to content

Commit

Permalink
remove dependencies of simple-util && jquery-mousewheel
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed May 19, 2015
1 parent 0da8088 commit a577ba3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
6 changes: 2 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-select",
"version": "2.0.6",
"version": "2.0.7",
"homepage": "https://github.com/mycolorway/simple-select",
"authors": [
"kshift <[email protected]>"
Expand All @@ -26,8 +26,6 @@
],
"dependencies": {
"jquery": "2.x",
"simple-module": "2.x",
"jquery-mousewheel": "~3.x",
"simple-util": "2.x"
"simple-module": "~2.0.5"
}
}
7 changes: 2 additions & 5 deletions lib/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,15 @@ Select = (function(superClass) {
})(this));
this.list.on("mousedown", (function(_this) {
return function(e) {
if (simple.util.browser.msie) {
if (window.navigator.userAgent.toLowerCase().indexOf('msie') > -1) {
_this._scrollMousedown = true;
setTimeout(function() {
return _this.input.focus();
}, 0);
}
return false;
};
})(this)).on("mousewheel", function(e, delta) {
$(this).scrollTop($(this).scrollTop() - 25 * delta);
return false;
}).on("mousedown", ".select-item", (function(_this) {
})(this)).on("mousedown", ".select-item", (function(_this) {
return function(e) {
var index;
index = _this.list.find(".select-item").index($(e.currentTarget));
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-select",
"version": "2.0.6",
"version": "2.0.7",
"description": "a simple select plugin based on Simple Module",
"repository": {
"type": "git",
Expand All @@ -14,9 +14,7 @@
"homepage": "https://github.com/mycolorway/simple-select",
"dependencies": {
"jquery": "2.x",
"simplemodule": "2.x",
"jquery-mousewheel": "3.x",
"simple-util": "2.x"
"simple-module": "~2.0.5"
},
"devDependencies": {
"grunt": "0.x",
Expand Down
5 changes: 1 addition & 4 deletions src/select.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,12 @@ class Select extends SimpleModule
return false

@list.on "mousedown", (e) =>
if simple.util.browser.msie
if window.navigator.userAgent.toLowerCase().indexOf('msie') > -1
@_scrollMousedown = true
setTimeout =>
@input.focus()
, 0
return false
.on "mousewheel", (e, delta) ->
$(@).scrollTop($(@).scrollTop() - 25 * delta)
return false
.on "mousedown", ".select-item", (e) =>
index = @list.find(".select-item").index $(e.currentTarget)
@selectItem index
Expand Down

0 comments on commit a577ba3

Please sign in to comment.